// Code generated by templ@(devel) DO NOT EDIT.
package components
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import "context"
import "io"
import "bytes"
import "git.src.quest/~skye/felu-ddns/internal/config"
func serviceName() string {
return config.FeluConfig.ServiceName
}
func BaseBase(title string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
templBuffer, templIsBuffer := w.(*bytes.Buffer)
if !templIsBuffer {
templBuffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
var_1 := templ.GetChildren(ctx)
if var_1 == nil {
var_1 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
_, err = templBuffer.WriteString("<!doctype html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><link rel=\"stylesheet\" type=\"text/css\" href=\"/static/styles.css\"><script src=\"/static/htmx.min.js\">")
if err != nil {
return err
}
var_2 := ``
_, err = templBuffer.WriteString(var_2)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</script><title>")
if err != nil {
return err
}
var var_3 string = title
_, err = templBuffer.WriteString(templ.EscapeString(var_3))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</title></head><body><main>")
if err != nil {
return err
}
err = var_1.Render(ctx, templBuffer)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</main><script src=\"/static/felu.js\">")
if err != nil {
return err
}
var_4 := ``
_, err = templBuffer.WriteString(var_4)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</script></body></html>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}
func Base(title string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
templBuffer, templIsBuffer := w.(*bytes.Buffer)
if !templIsBuffer {
templBuffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
var_5 := templ.GetChildren(ctx)
if var_5 == nil {
var_5 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
var_6 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
templBuffer, templIsBuffer := w.(*bytes.Buffer)
if !templIsBuffer {
templBuffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templBuffer)
}
_, err = templBuffer.WriteString("<div class=\"flex flex-col w-full items-center p-4\"><div class=\"flex flex-col items-center gap-4\"><a class=\"text-4xl\" href=\"/\">")
if err != nil {
return err
}
var var_7 string = serviceName()
_, err = templBuffer.WriteString(templ.EscapeString(var_7))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</a></div><div class=\"flex flex-col w-full max-w-5xl items-center gap-2\">")
if err != nil {
return err
}
err = var_5.Render(ctx, templBuffer)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div></div>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = io.Copy(w, templBuffer)
}
return err
})
err = BaseBase(title).Render(templ.WithChildren(ctx, var_6), templBuffer)
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}
func ManageBase(title string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
templBuffer, templIsBuffer := w.(*bytes.Buffer)
if !templIsBuffer {
templBuffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templBuffer)
}
ctx = templ.InitializeContext(ctx)
var_8 := templ.GetChildren(ctx)
if var_8 == nil {
var_8 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
var_9 := templ.ComponentFunc(func(ctx context.Context, w io.Writer) (err error) {
templBuffer, templIsBuffer := w.(*bytes.Buffer)
if !templIsBuffer {
templBuffer = templ.GetBuffer()
defer templ.ReleaseBuffer(templBuffer)
}
_, err = templBuffer.WriteString("<div class=\"flex flex-col w-full items-center p-4\"><div class=\"flex w-full max-w-5xl items-center gap-4\"><a href=\"/manage\">")
if err != nil {
return err
}
var var_10 string = serviceName()
_, err = templBuffer.WriteString(templ.EscapeString(var_10))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</a><a class=\"border p-1\" href=\"/manage/user\">")
if err != nil {
return err
}
var_11 := `User Settings`
_, err = templBuffer.WriteString(var_11)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</a><button class=\"border p-1\" hx-get=\"/auth/logout\">")
if err != nil {
return err
}
var_12 := `Logout`
_, err = templBuffer.WriteString(var_12)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</button></div><div class=\"flex flex-col w-full max-w-5xl items-center gap-2\">")
if err != nil {
return err
}
err = var_8.Render(ctx, templBuffer)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div></div>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = io.Copy(w, templBuffer)
}
return err
})
err = BaseBase(title).Render(templ.WithChildren(ctx, var_9), templBuffer)
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}