1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30
yattee/Shared/Videos/ThumbnailView.swift
2023-02-05 14:24:10 +01:00

21 lines
472 B
Swift

import SDWebImageSwiftUI
import SwiftUI
struct ThumbnailView: View {
var url: URL?
private let thumbnails = ThumbnailsModel.shared
var body: some View {
WebImage(url: url)
.resizable()
.onFailure { _ in
if let url {
thumbnails.insertUnloadable(url)
}
}
.placeholder {
Rectangle().fill(Color("PlaceholderColor"))
}
}
}