Refactor project structure and API
This commit is contained in:
47
Views/Cells/InfoCell.swift
Normal file
47
Views/Cells/InfoCell.swift
Normal file
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// InfoBarCell.swift
|
||||
// iKeyMon
|
||||
//
|
||||
// Created by tracer on 03.04.25.
|
||||
//
|
||||
|
||||
//
|
||||
// ResourcesBarRow.swift
|
||||
// iKeyMon
|
||||
//
|
||||
// Created by tracer on 31.03.25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct InfoCell: View {
|
||||
var value: [String]
|
||||
var monospaced: Bool = false
|
||||
var color: Color = .primary
|
||||
|
||||
init(value: [String], monospaced: Bool = false) {
|
||||
self.value = value
|
||||
self.monospaced = monospaced
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading) {
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
ForEach(value, id: \.self) { item in
|
||||
Text(item)
|
||||
.font(monospaced ? .system(.body, design: .monospaced) : .body)
|
||||
}
|
||||
}
|
||||
// if let subtext {
|
||||
// Text(subtext)
|
||||
// .font(.caption)
|
||||
// .foregroundColor(.secondary)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
InfoCell(value: ["Some Text", "Another Text"])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user