yattee/Shared/Views/ContentItemView.swift

37 lines
1.0 KiB
Swift
Raw Normal View History

import Foundation
import SwiftUI
struct ContentItemView: View {
let item: ContentItem
2022-12-12 00:18:29 +00:00
@Environment(\.listingStyle) private var listingStyle
var body: some View {
Group {
switch item.contentType {
2022-08-13 14:46:45 +00:00
case .video:
2022-12-12 00:18:29 +00:00
if listingStyle == .cells {
VideoCell(video: item.video)
} else {
PlayerQueueRow(item: .init(item.video))
.contextMenu {
VideoContextMenuView(video: item.video)
}
2022-12-12 18:46:31 +00:00
#if os(tvOS)
.padding(.horizontal, 30)
#endif
#if !os(tvOS)
Divider()
#endif
2022-12-12 00:18:29 +00:00
}
case .playlist:
2021-10-22 23:04:03 +00:00
ChannelPlaylistCell(playlist: item.playlist)
case .channel:
ChannelCell(channel: item.channel)
2022-03-27 10:49:57 +00:00
default:
PlaceholderCell()
}
}
}
}