Files
ShhShell/ShhShell/Views/Misc/HostSymbolPreview.swift
2025-08-16 10:31:37 +01:00

43 lines
822 B
Swift

//
// HostSymbolPreview.swift
// ShhShell
//
// Created by neon443 on 26/06/2025.
//
import SwiftUI
struct HostSymbolPreview: View {
@State var symbol: HostSymbol
@State var label: String
@State var small: Bool = false
var body: some View {
if small {
HStack(alignment: .center, spacing: 5) {
Text(label)
symbol.image
.resizable().scaledToFit()
.symbolRenderingMode(.monochrome)
}
} else {
ZStack(alignment: .center) {
symbol.image
.resizable().scaledToFit()
.symbolRenderingMode(.monochrome)
.blur(radius: 1)
symbol.image
.resizable().scaledToFit()
.symbolRenderingMode(.monochrome)
Text(label)
.font(.headline)
.offset(symbol.offset)
}
}
}
}
#Preview {
HostSymbolPreview(symbol: HostSymbol.desktopcomputer, label: "lo0")
}