kiwix-apple/Views/Library/ZimFileDetailPreview.swift
Balazs Perlaki-Horvath 3da4a34b52 Add import
2025-02-19 12:30:15 +01:00

45 lines
1.6 KiB
Swift

// This file is part of Kiwix for iOS & macOS.
//
// Kiwix is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// any later version.
//
// Kiwix is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Kiwix; If not, see https://www.gnu.org/licenses/.
import SwiftUI
import CoreData
struct ZimFileDetail_Previews: PreviewProvider {
static let context = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
static let zimFile: ZimFile = {
let zimFile = ZimFile(context: context)
zimFile.articleCount = 1000000
zimFile.category = "wikipedia"
zimFile.created = Date()
zimFile.downloadURL = URL(string: "https://www.example.com")
zimFile.fileID = UUID()
zimFile.fileDescription = "A very long description"
zimFile.flavor = "max"
zimFile.hasDetails = true
zimFile.hasPictures = false
zimFile.hasVideos = true
zimFile.languageCode = "en"
zimFile.mediaCount = 100
zimFile.name = "Wikipedia Zim File Name"
zimFile.persistentID = ""
zimFile.size = 1000000000
return zimFile
}()
static var previews: some View {
ZimFileDetail(zimFile: zimFile, dismissParent: nil).frame(width: 300).previewLayout(.sizeThatFits)
}
}