// templui component form - version: v0.84.0 installed by templui v0.84.0 package form import ( "git.jmbit.de/jmb/scanfile/server/web/templui/components/label" "git.jmbit.de/jmb/scanfile/server/web/templui/utils" ) type MessageVariant string const ( MessageVariantError MessageVariant = "error" MessageVariantInfo MessageVariant = "info" ) type ItemProps struct { ID string Class string Attributes templ.Attributes } type LabelProps struct { ID string Class string Attributes templ.Attributes For string DisabledClass string } type DescriptionProps struct { ID string Class string Attributes templ.Attributes } type MessageProps struct { ID string Class string Attributes templ.Attributes Variant MessageVariant } templ Item(props ...ItemProps) { {{ var p ItemProps }} if len(props) > 0 { {{ p = props[0] }} }
{ children... }
} templ ItemFlex(props ...ItemProps) { {{ var p ItemProps }} if len(props) > 0 { {{ p = props[0] }} }
{ children... }
} templ Label(props ...LabelProps) { {{ var p LabelProps }} if len(props) > 0 { {{ p = props[0] }} } @label.Label(label.Props{ ID: p.ID, Class: p.Class, Attributes: p.Attributes, For: p.For, }) { { children... } } } templ Description(props ...DescriptionProps) { {{ var p DescriptionProps }} if len(props) > 0 { {{ p = props[0] }} }

{ children... }

} templ Message(props ...MessageProps) { {{ var p MessageProps }} if len(props) > 0 { {{ p = props[0] }} }

{ children... }

} func messageVariantClass(variant MessageVariant) string { switch variant { case MessageVariantError: return "text-red-500" case MessageVariantInfo: return "text-blue-500" default: return "" } }