2023-08-18 22:47:24 +02:00
|
|
|
import SwiftUI
|
|
|
|
import SFSafeSymbols
|
|
|
|
|
|
|
|
struct LeftImageLabel: View {
|
|
|
|
|
|
|
|
let text: String
|
|
|
|
|
|
|
|
let systemSymbol: SFSymbol
|
|
|
|
|
|
|
|
init(_ text: String, systemSymbol: SFSymbol) {
|
|
|
|
self.text = text
|
|
|
|
self.systemSymbol = systemSymbol
|
|
|
|
}
|
|
|
|
|
|
|
|
var body: some View {
|
2023-08-23 16:17:34 +02:00
|
|
|
HStack(alignment: .firstTextBaseline, spacing: 0) {
|
2023-08-18 22:47:24 +02:00
|
|
|
Text(text)
|
|
|
|
Image(systemSymbol: systemSymbol)
|
|
|
|
.frame(width: 20)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct LeftImageLabel_Previews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
|
|
|
LeftImageLabel("Home address", systemSymbol: .house)
|
|
|
|
}
|
|
|
|
}
|