package components // ConfigSectionData represents data for a configuration section type ConfigSectionData struct { Title string Icon string Description string Fields []interface{} // Will hold field data structures } // InfoSectionData represents data for an informational section type InfoSectionData struct { Title string Icon string Type string // "info", "warning", "success", "danger" Content string } // ConfigSection renders a Bootstrap card for configuration settings templ ConfigSection(data ConfigSectionData) {
if data.Icon != "" { } { data.Title }
if data.Description != "" { { data.Description } }
for _, field := range data.Fields { switch v := field.(type) { case TextFieldData: @TextField(v) case NumberFieldData: @NumberField(v) case CheckboxFieldData: @CheckboxField(v) case SelectFieldData: @SelectField(v) case DurationFieldData: @DurationField(v) case DurationInputFieldData: @DurationInputField(v) } }
} // InfoSection renders a Bootstrap alert section for informational content templ InfoSection(data InfoSectionData) {
if data.Icon != "" { } { data.Title }
}