27 lines
946 B
Swift
27 lines
946 B
Swift
import SwiftUI
|
|
|
|
struct ResourceCard<Content: View>: View {
|
|
let title: LocalizedStringKey
|
|
let symbol: String
|
|
let color: Color
|
|
let value: String
|
|
@ViewBuilder var content: () -> Content
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
HStack {
|
|
Label(title, systemImage: symbol).font(.system(size: 13, weight: .semibold)).foregroundStyle(color)
|
|
Spacer(minLength: 6)
|
|
Text(verbatim: value).font(.system(size: 20, weight: .semibold, design: .rounded)).monospacedDigit()
|
|
}
|
|
content()
|
|
Spacer(minLength: 0)
|
|
}
|
|
.font(.system(size: 11))
|
|
.padding(12)
|
|
.frame(maxWidth: .infinity, minHeight: 250, alignment: .topLeading)
|
|
.background(Color("PanelCard"), in: .rect(cornerRadius: 14))
|
|
.overlay(RoundedRectangle(cornerRadius: 14).strokeBorder(.primary.opacity(0.1)))
|
|
}
|
|
}
|