package templates import "net/http" import "sonarqube-badge/router/utils" import "github.com/golang-jwt/jwt/v5" import "strings" func isActive(title string, key string) string { if strings.HasPrefix(title, key) { return "active" } return "" } templ head(title string) { { title } } templ header(loggedIn bool, title string) { } templ layout(component templ.Component, title string, token *jwt.Token) { @head(title) @header(token != nil, title)
@component
} func Layout(component templ.Component, title string, req *http.Request) templ.Component { token, _ := utils.GetToken(req) return layout(component, title, token); }