Unified detail views, model

This commit is contained in:
Christoph Hagen
2024-12-16 09:54:21 +01:00
parent 1e67a99866
commit 31d1ecb8bd
57 changed files with 853 additions and 954 deletions

View File

@ -2,9 +2,9 @@ import SwiftUI
struct FilePropertyView: View {
let title: String
let title: LocalizedStringKey
let description: String
let footer: LocalizedStringKey
@Binding
var selectedFile: FileResource?
@ -13,9 +13,7 @@ struct FilePropertyView: View {
private var showFileSelectionSheet = false
var body: some View {
VStack(alignment: .leading) {
Text(title)
.font(.headline)
GenericPropertyView(title: title, footer: footer) {
HStack {
Text(selectedFile?.id ?? "No file selected")
Spacer()
@ -23,9 +21,6 @@ struct FilePropertyView: View {
showFileSelectionSheet = true
}
}
Text(description)
.foregroundStyle(.secondary)
.padding(.bottom)
}
.sheet(isPresented: $showFileSelectionSheet) {
FileSelectionView(selectedFile: $selectedFile)