1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30
yattee/Shared/Player/RelatedView.swift
2021-11-03 20:53:37 +01:00

31 lines
799 B
Swift

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)
.listStyle(.inset)
#elseif os(iOS)
.listStyle(.grouped)
#else
.listStyle(.plain)
#endif
}
}
struct RelatedView_Previews: PreviewProvider {
static var previews: some View {
RelatedView()
}
}