add middlewares, handlers and database models

This commit is contained in:
juancwu 2025-12-16 10:46:34 -05:00
commit 7e288ea67a
24 changed files with 1045 additions and 14 deletions

View file

@ -0,0 +1,30 @@
package blocks
import (
"git.juancwu.dev/juancwu/budgething/internal/ui/components/button"
"git.juancwu.dev/juancwu/budgething/internal/ui/components/icon"
)
type ThemeSwitcherProps struct {
Class string
}
// ThemeSwitcher renders only the UI button.
// The interactive script is handled globally in the layout.
templ ThemeSwitcher(props ...ThemeSwitcherProps) {
{{ var p ThemeSwitcherProps }}
if len(props) > 0 {
{{ p = props[0] }}
}
@button.Button(button.Props{
Size: button.SizeIcon,
Variant: button.VariantGhost,
Class: p.Class,
Attributes: templ.Attributes{
"data-theme-switcher": "true",
"aria-label": "Toggle theme",
},
}) {
@icon.Eclipse(icon.Props{Size: 20})
}
}