1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30
yattee/Shared/Views/ContentItemView.swift
2023-02-05 14:24:09 +01:00

30 lines
838 B
Swift

import Foundation
import SwiftUI
struct ContentItemView: View {
let item: ContentItem
@Environment(\.listingStyle) private var listingStyle
var body: some View {
Group {
switch item.contentType {
case .video:
if listingStyle == .cells {
VideoCell(video: item.video)
} else {
PlayerQueueRow(item: .init(item.video))
.contextMenu {
VideoContextMenuView(video: item.video)
}
}
case .playlist:
ChannelPlaylistCell(playlist: item.playlist)
case .channel:
ChannelCell(channel: item.channel)
default:
PlaceholderCell()
}
}
}
}