mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 14:20:32 +05:30
26 lines
526 B
Swift
26 lines
526 B
Swift
import Siesta
|
|
import SwiftUI
|
|
|
|
struct WatchNowPlaylistSection: View {
|
|
@ObservedObject private var store = Store<Playlist>()
|
|
|
|
let id: String
|
|
|
|
var resource: Resource {
|
|
InvidiousAPI.shared.playlist(id)
|
|
}
|
|
|
|
init(id: String) {
|
|
self.id = id
|
|
|
|
resource.addObserver(store)
|
|
}
|
|
|
|
var body: some View {
|
|
WatchNowSectionBody(label: store.item?.title ?? "Loading", videos: store.item?.videos ?? [])
|
|
.onAppear {
|
|
resource.loadIfNeeded()
|
|
}
|
|
}
|
|
}
|