remove hiding hte label if its empty

This commit is contained in:
neon443
2025-08-16 10:31:37 +01:00
parent d7f498c164
commit 700c169e55

View File

@@ -15,10 +15,7 @@ struct HostSymbolPreview: View {
var body: some View { var body: some View {
if small { if small {
HStack(alignment: .center, spacing: 5) { HStack(alignment: .center, spacing: 5) {
if !label.isEmpty {
Text(label) Text(label)
.font(.headline)
}
symbol.image symbol.image
.resizable().scaledToFit() .resizable().scaledToFit()
.symbolRenderingMode(.monochrome) .symbolRenderingMode(.monochrome)
@@ -32,7 +29,6 @@ struct HostSymbolPreview: View {
symbol.image symbol.image
.resizable().scaledToFit() .resizable().scaledToFit()
.symbolRenderingMode(.monochrome) .symbolRenderingMode(.monochrome)
if !label.isEmpty {
Text(label) Text(label)
.font(.headline) .font(.headline)
.offset(symbol.offset) .offset(symbol.offset)
@@ -40,7 +36,6 @@ struct HostSymbolPreview: View {
} }
} }
} }
}
#Preview { #Preview {
HostSymbolPreview(symbol: HostSymbol.desktopcomputer, label: "lo0") HostSymbolPreview(symbol: HostSymbol.desktopcomputer, label: "lo0")