mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
28 lines
620 B
Swift
28 lines
620 B
Swift
import SwiftUI
|
|
|
|
struct VideosCellsView: View {
|
|
@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, showsIndicators: false) {
|
|
LazyVGrid(columns: items, spacing: 10) {
|
|
ForEach(videos) { video in
|
|
VideoCellView(video: video)
|
|
}
|
|
}
|
|
.padding()
|
|
}
|
|
}
|
|
|
|
var items: [GridItem] {
|
|
Array(repeating: .init(.fixed(600)), count: columns)
|
|
}
|
|
}
|