2022-11-19 04:09:52 +05:30
|
|
|
import Defaults
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct RecentDocumentsView: View {
|
|
|
|
var limit = 3
|
|
|
|
let model = DocumentsModel.shared
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
LazyVStack {
|
|
|
|
if recentDocuments.isEmpty {
|
|
|
|
NoDocumentsView()
|
|
|
|
} else {
|
|
|
|
ForEach(recentDocuments, id: \.absoluteString) { url in
|
2022-12-04 17:51:50 +05:30
|
|
|
let video = Video.local(model.standardizedURL(url) ?? url)
|
2022-11-19 04:09:52 +05:30
|
|
|
PlayerQueueRow(
|
|
|
|
item: PlayerQueueItem(video)
|
|
|
|
)
|
|
|
|
.contextMenu {
|
|
|
|
VideoContextMenuView(video: video)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.padding(.horizontal, 15)
|
|
|
|
}
|
|
|
|
|
|
|
|
var recentDocuments: [URL] {
|
|
|
|
model.recentDocuments(limit)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct RecentDocumentsView_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
RecentDocumentsView()
|
|
|
|
}
|
|
|
|
}
|