yattee/Shared/Player/RelatedView.swift

31 lines
787 B
Swift
Raw Normal View History

2021-11-02 23:02:02 +00:00
import SwiftUI
struct RelatedView: View {
@EnvironmentObject<PlayerModel> private var player
var body: some View {
List {
if !player.currentVideo.isNil, !player.currentVideo!.related.isEmpty {
Section(header: Text("Related")) {
ForEach(player.currentVideo!.related) { video in
PlayerQueueRow(item: PlayerQueueItem(video), fullScreen: .constant(false))
}
}
}
}
#if os(macOS)
2021-11-08 16:29:35 +00:00
.listStyle(.inset)
2021-11-02 23:02:02 +00:00
#elseif os(iOS)
2021-11-08 16:29:35 +00:00
.listStyle(.grouped)
2021-11-02 23:02:02 +00:00
#else
2021-11-08 16:29:35 +00:00
.listStyle(.plain)
2021-11-02 23:02:02 +00:00
#endif
}
}
struct RelatedView_Previews: PreviewProvider {
static var previews: some View {
RelatedView()
}
}