mirror of
https://github.com/yattee/yattee.git
synced 2024-11-14 01:58:24 +00:00
21 lines
488 B
Swift
21 lines
488 B
Swift
import SDWebImageSwiftUI
|
|
import SwiftUI
|
|
|
|
struct ThumbnailView: View {
|
|
var url: URL?
|
|
@ObservedObject private var thumbnails = ThumbnailsModel.shared
|
|
|
|
var body: some View {
|
|
WebImage(url: url)
|
|
.resizable()
|
|
.onFailure { _ in
|
|
if let url {
|
|
thumbnails.insertUnloadable(url)
|
|
}
|
|
}
|
|
.placeholder {
|
|
Rectangle().fill(Color("PlaceholderColor"))
|
|
}
|
|
}
|
|
}
|