2021-10-22 04:59:10 +05:30
|
|
|
import Foundation
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct ContentItemView: View {
|
|
|
|
let item: ContentItem
|
2022-12-12 05:48:29 +05:30
|
|
|
@Environment(\.listingStyle) private var listingStyle
|
2021-10-22 04:59:10 +05:30
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
Group {
|
|
|
|
switch item.contentType {
|
2022-08-13 20:16:45 +05:30
|
|
|
case .video:
|
2022-12-12 05:48:29 +05:30
|
|
|
if listingStyle == .cells {
|
|
|
|
VideoCell(video: item.video)
|
|
|
|
} else {
|
|
|
|
PlayerQueueRow(item: .init(item.video))
|
|
|
|
.contextMenu {
|
|
|
|
VideoContextMenuView(video: item.video)
|
|
|
|
}
|
|
|
|
}
|
2021-10-22 04:59:10 +05:30
|
|
|
case .playlist:
|
2021-10-23 04:34:03 +05:30
|
|
|
ChannelPlaylistCell(playlist: item.playlist)
|
2021-10-22 04:59:10 +05:30
|
|
|
case .channel:
|
|
|
|
ChannelCell(channel: item.channel)
|
2022-03-27 16:19:57 +05:30
|
|
|
default:
|
|
|
|
PlaceholderCell()
|
2021-10-22 04:59:10 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|