package components import "github.com/tigorlazuardi/redmage/views" import "strings" templ Navigation(c *views.Context) {
{ children... }
} func cx(m map[string]bool) string { var res string for k, v := range m { if v { res += k + " " } } return res } func classForNavItem(c *views.Context, prefix string) string { classNames := map[string]bool{} if prefix == "/" && c.Request.URL.Path == "/" { classNames["font-bold"] = true return cx(classNames) } else if strings.HasPrefix(c.Request.URL.Path, prefix) && prefix != "/" { classNames["font-bold"] = true } return cx(classNames) } templ navLogo() { } templ Navbar(c *views.Context) { } templ navList(c *views.Context) { }