// 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/config"
func getDomainPattern() string {
return config.FeluConfig.DNSPattern
}
func Manage() 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)
var_2 := 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=\"bg-teal-200\"><form class=\"flex flex-col p-2 gap-2\" hx-post=\"/manage/domains\" hx-target=\"#add_domain_error\"><label for=\"domain\">")
if err != nil {
return err
}
var_3 := `Domain`
_, err = templBuffer.WriteString(var_3)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</label><div><input class=\"border\" type=\"text\" placeholder=\"...\" name=\"domain\" id=\"domain\"><span>")
if err != nil {
return err
}
var var_4 string = getDomainPattern()
_, err = templBuffer.WriteString(templ.EscapeString(var_4))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</span></div><label for=\"a_record\">")
if err != nil {
return err
}
var_5 := `A Record`
_, err = templBuffer.WriteString(var_5)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</label><input class=\"border\" type=\"text\" placeholder=\"...\" name=\"a_record\" id=\"a_record\"><div class=\"text-rose-600 text-center\" id=\"add_domain_error\"></div><button class=\"border p-1\" type=\"submit\">")
if err != nil {
return err
}
var_6 := `Add`
_, err = templBuffer.WriteString(var_6)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</button></form></div> <div hx-get=\"/manage/partials/domains\" hx-trigger=\"load, update-domain-list from:body\" hx-target=\"this\"></div>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = io.Copy(w, templBuffer)
}
return err
})
err = ManageBase("Manage").Render(templ.WithChildren(ctx, var_2), templBuffer)
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}
func ManageSettings() 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_7 := templ.GetChildren(ctx)
if var_7 == nil {
var_7 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
var_8 := 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>")
if err != nil {
return err
}
var_9 := `user settings here, like updating email and password`
_, err = templBuffer.WriteString(var_9)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = io.Copy(w, templBuffer)
}
return err
})
err = ManageBase("Settings").Render(templ.WithChildren(ctx, var_8), templBuffer)
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}