package ui import "fmt" type FontAwesome string type IconFunc func(name string) templ.Component const ( FaSolid FontAwesome = "fa-solid" FaRegular FontAwesome = "fa-regular" FaLight FontAwesome = "fa-light" FaThin FontAwesome = "fa-thin" FaDuotone FontAwesome = "fa-duotone fa-solid" FaSharpSolid FontAwesome = "fa-sharp fa-solid" FaSharpRegular FontAwesome = "fa-sharp fa-regular" FaSharpLight FontAwesome = "fa-sharp fa-light" FaSharpThin FontAwesome = "fa-sharp fa-thin" FaSharpDuotone FontAwesome = "fa-sharp-duotone fa-solid" FaBrands FontAwesome = "fa-brands" ) func Icon(s FontAwesome) IconFunc { return func(name string) templ.Component { return renderIcon(s, name) } } func renderIcon(s FontAwesome, name string) templ.Component { return faIcon(formatIconClass(s, name)) } func formatIconClass(s FontAwesome, name string) string { return fmt.Sprintf("%s %s", string(s), name) } templ faIcon(class string) { } templ RegularIcon() { } templ LightIcon() { } templ ThinIcon() { } templ BrandsIcon() { }