Improve asset handling

This commit is contained in:
Christoph Hagen
2024-12-16 15:36:58 +01:00
parent 31d1ecb8bd
commit b22b76fd32
21 changed files with 264 additions and 85 deletions

View File

@ -9,6 +9,15 @@ struct FilePropertyView: View {
@Binding
var selectedFile: FileResource?
let allowedType: FileFilterType?
init(title: LocalizedStringKey, footer: LocalizedStringKey, selectedFile: Binding<FileResource?>, allowedType: FileFilterType? = nil) {
self.title = title
self.footer = footer
self._selectedFile = selectedFile
self.allowedType = allowedType
}
@State
private var showFileSelectionSheet = false
@ -23,7 +32,7 @@ struct FilePropertyView: View {
}
}
.sheet(isPresented: $showFileSelectionSheet) {
FileSelectionView(selectedFile: $selectedFile)
FileSelectionView(selectedFile: $selectedFile, allowedType: allowedType)
}
}
}