package application import "gitlab.unjx.de/flohoss/godash/services" import "html/template" var ImageTemplate = template.Must(template.New("bar").Parse("
")) type Bar struct { Background string Icon string } func backgroundColor(config string) string { result := "p-[0.05rem] " switch config { case "dark": return result + "bg-black " case "light": return result + "bg-white " case "base": return result + "bg-base-300 " default: return "" } } templ Application(application services.Application) { @templ.FromGoHTML(ImageTemplate, Bar{Background: backgroundColor(application.Background), Icon: application.Icon})