mirror of
https://github.com/yattee/yattee.git
synced 2025-12-30 08:22:31 +00:00
Watch Now section, horizontal cells
This commit is contained in:
23
Shared/Watch Now/WatchNowSection.swift
Normal file
23
Shared/Watch Now/WatchNowSection.swift
Normal file
@@ -0,0 +1,23 @@
|
||||
import Siesta
|
||||
import SwiftUI
|
||||
|
||||
struct WatchNowSection: View {
|
||||
@ObservedObject private var store = Store<[Video]>()
|
||||
|
||||
let resource: Resource
|
||||
let label: String
|
||||
|
||||
init(resource: Resource, label: String) {
|
||||
self.resource = resource
|
||||
self.label = label
|
||||
|
||||
self.resource.addObserver(store)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
WatchNowSectionBody(label: label, videos: store.collection)
|
||||
.onAppear {
|
||||
resource.loadIfNeeded()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user