1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 23:00:32 +05:30
yattee/Apple TV/VideosCellsView.swift

30 lines
648 B
Swift
Raw Normal View History

2021-06-24 03:49:58 +05:30
import SwiftUI
struct VideosCellsView: View {
@EnvironmentObject private var state: AppState
@State private var columns: Int
init(videos: [Video], columns: Int = 3) {
self.videos = videos
self.columns = columns
}
var videos = [Video]()
var body: some View {
ScrollView(.vertical) {
LazyVGrid(columns: items, spacing: 10) {
ForEach(videos) { video in
VideoCellView(video: video)
}
}
.padding()
}
}
var items: [GridItem] {
Array(repeating: .init(.fixed(600)), count: columns)
}
}