package webui import ( "context" "fmt" "html" "io" "github.com/a-h/templ" "satoru/internal/store" ) type PasswordPageData struct { User store.User Error string } func ChangePassword(data PasswordPageData) templ.Component { return templ.ComponentFunc(func(_ context.Context, w io.Writer) error { errBlock := "" if data.Error != "" { errBlock = fmt.Sprintf(`

%s

`, html.EscapeString(data.Error)) } _, err := io.WriteString(w, fmt.Sprintf(` Change Password ยท Satoru

Satoru

Change Password

User: %s

%s

Back to dashboard

`, html.EscapeString(data.User.Username), errBlock, )) return err }) }