Luminate/Sources/LuminateHome/MediaRow.swift

39 lines
932 B
Swift

import Adwaita
import Foundation
import LuminateCore
struct MediaRow: View {
var title: String
var items: [Components.Schemas.BaseItemDto]
@Binding var navigation: NavigationStack<Page>
var onSeeAll: (() -> Void)?
var view: Body {
VStack(spacing: 16) {
HStack {
Text(title)
.title3()
/// Poor man's `Spacer()`
Bin()
.hexpand()
if let onSeeAll {
Button("See All") {
onSeeAll()
}
}
}
ScrollView {
ForEach(items, horizontal: true) { item in
HomePosterCell(item: item)
.padding(16, .trailing)
}
}
.vscrollbarPolicy(.never)
.hscrollbarPolicy(.external)
}
}
}