Improve asset handling
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user