2024-03-14 20:39:26 +00:00
|
|
|
package components
|
2024-03-15 03:56:49 +00:00
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type InfoBoxConfig struct {
|
|
|
|
ColourClass string
|
|
|
|
InFlex bool
|
|
|
|
FlexBasis string
|
|
|
|
}
|
|
|
|
|
|
|
|
templ InfoBox(ibc InfoBoxConfig, title string, child templ.Component) {
|
|
|
|
<div class={
|
|
|
|
"infobox",
|
|
|
|
fmt.Sprintf("bg-%s-900", ibc.ColourClass),
|
|
|
|
fmt.Sprintf("text-%s-100", ibc.ColourClass),
|
|
|
|
fmt.Sprintf("shadow-%s-900", ibc.ColourClass),
|
|
|
|
fmt.Sprintf("divide-%s-800", ibc.ColourClass),
|
|
|
|
fmt.Sprintf("border-%s-800", ibc.ColourClass),
|
|
|
|
templ.KV(ibc.FlexBasis, ibc.InFlex),
|
|
|
|
}>
|
|
|
|
<h3 class="text-xl font-semibold">{ title }</h3>
|
|
|
|
@child
|
|
|
|
</div>
|
|
|
|
}
|