Files

35 lines
588 B
Swift

import Elementary
public struct Row<Body: HTML>: HTML {
let body: Body
public init(
@HTMLBuilder body: () -> Body
) {
self.body = body()
}
public var content: some HTML<HTMLTag.div> {
div(.class("flex justify-between")) {
body
}
}
}
public extension Row
where Body == _HTMLTuple2<HTMLElement<HTMLTag.span, HTMLText>, HTMLElement<HTMLTag.span, HTMLText>>
{
init(
label: String,
value: String
) {
self.init {
span(.class("font-bold")) { label }
span { value }
}
}
}
extension Row: Sendable where Body: Sendable {}