Full generation, file type cleanup

This commit is contained in:
Christoph Hagen
2024-12-25 18:06:05 +01:00
parent 41887a1401
commit 1e4682dad1
56 changed files with 1577 additions and 1103 deletions

View File

@ -24,7 +24,7 @@ struct FileContentView: View {
}
.foregroundStyle(.secondary)
} else {
switch file.type {
switch file.type.category {
case .image:
file.imageToDisplay
.resizable()
@ -39,7 +39,7 @@ struct FileContentView: View {
.font(.title)
}
.foregroundStyle(.secondary)
case .text, .code:
case .text, .code, .asset:
TextFileContentView(file: file)
.id(file.id)
case .video:
@ -52,7 +52,7 @@ struct FileContentView: View {
.font(.title)
}
.foregroundStyle(.secondary)
case .other:
case .resource:
VStack {
Image(systemSymbol: .docQuestionmark)
.resizable()
@ -62,6 +62,16 @@ struct FileContentView: View {
.font(.title)
}
.foregroundStyle(.secondary)
case .audio:
VStack {
Image(systemSymbol: .waveformPath)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: iconSize)
Text("No preview available")
.font(.title)
}
.foregroundStyle(.secondary)
}
}
}.padding()