package templates
templ Header(user User, currentPath string) {
@Icon("book-open", "h-6 w-6 text-brand")
Bookhoard
@Icon("search", "h-4 w-4")
@Icon("palette", "h-5 w-5")
Theme
for _, t := range ThemeOptions {
{ t.Label }
if t.Name == user.Theme {
@Icon("check", "h-4 w-4 text-brand")
}
}
Bookshelf background
for _, w := range WoodOptions {
if w.Name == "none" {
} else {
}
{ w.Label }
}
if user.ID != "" {
@Icon("user", "h-5 w-5")
{ user.Username }
} else {
@Icon("user", "h-5 w-5")
Login
@HeaderLoginForm("", currentPath)
}
@Icon("menu", "h-5 w-5")
@Icon("search", "h-4 w-4")
@Icon("library", "h-4 w-4") Library
@Icon("book", "h-4 w-4") All Books
@Icon("layers", "h-4 w-4") Series
@Icon("folder", "h-4 w-4") Collections
@Icon("clock", "h-4 w-4") Progress
@Icon("device", "h-4 w-4") Devices
@Icon("palette", "h-4 w-4 text-content-muted")
Theme
for _, t := range ThemeOptions {
{ t.Label }
}
for _, w := range WoodOptions {
if w.Name == "none" {
} else {
}
{ w.Label }
}
if user.ID != "" {
@Icon("user", "h-4 w-4 text-content-muted")
Profile
if user.Role == "admin" {
@Icon("shield", "h-4 w-4 text-content-muted")
Admin Panel
}
@Icon("logout", "h-4 w-4")
Logout
} else {
@HeaderLoginForm("-mobile", currentPath)
}
}
// HeaderLoginForm renders the compact inline login form used in the header
// dropdown (desktop) and mobile drawer. suffix is appended to element ids so
// the two instances do not collide.
templ HeaderLoginForm(suffix string, currentPath string) {
Don't have an account? Sign Up
}