26 lines
523 B
Swift
26 lines
523 B
Swift
import Elementary
|
|
|
|
public struct Note: HTML, Sendable {
|
|
let label: String
|
|
let text: String
|
|
|
|
public init(_ label: String = "Note:", _ text: () -> String) {
|
|
self.label = label
|
|
self.text = text()
|
|
}
|
|
|
|
public var content: some HTML {
|
|
div(
|
|
.class(
|
|
"""
|
|
mt-8 p-4 bg-gray-100 dark:bg-gray-700 rounded-md shadow-md
|
|
border border-blue-500 text-blue-500 text-sm
|
|
"""
|
|
)
|
|
) {
|
|
p(.class("font-extrabold mb-3")) { label }
|
|
p(.class("px-6")) { text }
|
|
}
|
|
}
|
|
}
|