43 lines
892 B
Swift
43 lines
892 B
Swift
//
|
|
// InfoView.swift
|
|
// iKeyMon
|
|
//
|
|
// Created by tracer on 30.03.25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct InfoRow: View {
|
|
var label: String
|
|
var value: [String]
|
|
var color: Color = .primary
|
|
|
|
init(label: String, value: String) {
|
|
self.label = label
|
|
self.value = [value]
|
|
}
|
|
|
|
init(label: String, value: [String]) {
|
|
self.label = label
|
|
self.value = value
|
|
}
|
|
|
|
var body: some View {
|
|
HStack(alignment: .top) {
|
|
Text(label)
|
|
.foregroundStyle(.secondary)
|
|
.frame(width: 160, alignment: .leading)
|
|
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
ForEach(value, id: \.self) { item in
|
|
Text(item)
|
|
}
|
|
}
|
|
}
|
|
.padding(.vertical, 4)
|
|
}
|
|
}
|
|
#Preview {
|
|
InfoRow(label: "Hostname", value: "keyhelp.lab.24unix.net")
|
|
}
|