// templui component alert - version: v0.84.0 installed by templui v0.84.0 package alert import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" type Variant string const ( VariantDefault Variant = "default" VariantDestructive Variant = "destructive" ) type Props struct { ID string Class string Attributes templ.Attributes Variant Variant } type TitleProps struct { ID string Class string Attributes templ.Attributes } type DescriptionProps struct { ID string Class string Attributes templ.Attributes } templ Alert(props ...Props) { {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} }
svg]:absolute [&>svg]:left-4 [&>svg]:top-4", "[&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11", "rounded-lg border", variantClasses(p.Variant), p.Class, ), } role="alert" { p.Attributes... } > { children... }
} templ Title(props ...TitleProps) { {{ var p TitleProps }} if len(props) > 0 { {{ p = props[0] }} }
{ children... }
} templ Description(props ...DescriptionProps) { {{ var p DescriptionProps }} if len(props) > 0 { {{ p = props[0] }} }
{ children... }
} func variantClasses(variant Variant) string { switch variant { case VariantDestructive: return "border-destructive text-destructive" default: return "border-border text-foreground" } }