diff options
Diffstat (limited to 'Hotline/Shared/FileIconView.swift')
| -rw-r--r-- | Hotline/Shared/FileIconView.swift | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Hotline/Shared/FileIconView.swift b/Hotline/Shared/FileIconView.swift index 7336cf3..ffc9051 100644 --- a/Hotline/Shared/FileIconView.swift +++ b/Hotline/Shared/FileIconView.swift @@ -1,6 +1,22 @@ import SwiftUI import UniformTypeIdentifiers +struct FolderIconView: View { + private func folderIcon() -> Image { +#if os(iOS) + return Image(systemName: "folder.fill") +#elseif os(macOS) + return Image(nsImage: NSWorkspace.shared.icon(for: UTType.folder)) +#endif + } + + var body: some View { + folderIcon() + .resizable() + .scaledToFit() + } +} + struct FileIconView: View { let filename: String |