26 lines
608 B
Swift
26 lines
608 B
Swift
import Elementary
|
|
|
|
public struct VerticalGroup: HTML, Sendable {
|
|
let label: String
|
|
let value: String
|
|
let valueLabel: String?
|
|
|
|
public init(label: String, value: String, valueLabel: String? = nil) {
|
|
self.label = label
|
|
self.value = value
|
|
self.valueLabel = valueLabel
|
|
}
|
|
|
|
public var content: some HTML<HTMLTag.div> {
|
|
div(.class("grid grid-cols-1 justify-items-center")) {
|
|
p(.class("font-medium")) { label }
|
|
h3(.class("text-3xl font-extrabold")) {
|
|
value
|
|
if let valueLabel {
|
|
span(.class("text-lg ms-2")) { valueLabel }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|