Impressia/Vernissage/Widgets/LabelIcon.swift

29 lines
652 B
Swift
Raw Normal View History

2022-12-29 17:27:15 +01:00
//
// https://mczachurski.dev
// Copyright © 2022 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import SwiftUI
2023-01-03 14:09:22 +01:00
struct LabelIcon: View {
2022-12-29 17:27:15 +01:00
let iconName: String
let value: String
var body: some View {
2023-01-04 17:56:01 +01:00
HStack(alignment: .center) {
2022-12-29 17:27:15 +01:00
Image(systemName: iconName)
2023-01-04 17:56:01 +01:00
.frame(width: 30, alignment: .leading)
2022-12-29 17:27:15 +01:00
Text(value)
.font(.footnote)
}
2023-01-04 17:56:01 +01:00
.padding(.vertical, 2)
2022-12-29 17:27:15 +01:00
}
}
struct LabelIconView_Previews: PreviewProvider {
static var previews: some View {
2023-01-03 14:09:22 +01:00
LabelIcon(iconName: "camera", value: "Sony A7")
2022-12-29 17:27:15 +01:00
}
}