package main // statPairComponent renders the corporate-modernist:stat_pair block. templ statPairComponent(data StatPairData) {
if data.Title != "" {

{ data.Title }

} if len(data.Stats) > 0 {
for _, s := range data.Stats {
{ s.Figure }
if s.Label != "" {
{ s.Label }
} if s.Source != "" {
{ s.Source }
}
}
} else {

No statistics configured.

}
} // statPairColumnSpan picks a column span based on how many stats are configured. func statPairColumnSpan(count int) string { switch { case count >= 4: return "grid-column: span 3 / span 3;" case count == 3: return "grid-column: span 4 / span 4;" case count == 2: return "grid-column: span 6 / span 6;" default: return "grid-column: span 12 / span 12;" } }