// 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/db"
import "strconv"
func AdminPartialUsersList(users []db.User) 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("<table class=\"table-auto\"><thead><tr><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_2 := `Id`
_, err = templBuffer.WriteString(var_2)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_3 := `Email`
_, err = templBuffer.WriteString(var_3)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_4 := `Is Admin`
_, err = templBuffer.WriteString(var_4)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th></tr></thead><tbody>")
if err != nil {
return err
}
for _, user := range users {
_, err = templBuffer.WriteString("<tr class=\"border\"><td><div class=\"p-2\"><input class=\"border\" value=\"")
if err != nil {
return err
}
_, err = templBuffer.WriteString(templ.EscapeString(user.Id))
if err != nil {
return err
}
_, err = templBuffer.WriteString("\" disabled></div></td><td><div class=\"p-2\">")
if err != nil {
return err
}
var var_5 string = user.Email
_, err = templBuffer.WriteString(templ.EscapeString(var_5))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div></td><td><div class=\"p-2\">")
if err != nil {
return err
}
var var_6 string = strconv.FormatBool(user.IsAdmin)
_, err = templBuffer.WriteString(templ.EscapeString(var_6))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div></td></tr>")
if err != nil {
return err
}
}
_, err = templBuffer.WriteString("</tbody></table>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}
func AdminPartialDomainsList(domains []db.Domain) 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)
_, err = templBuffer.WriteString("<table class=\"table-auto\"><thead><tr><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_8 := `Id`
_, err = templBuffer.WriteString(var_8)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_9 := `Domain`
_, err = templBuffer.WriteString(var_9)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_10 := `A Record`
_, err = templBuffer.WriteString(var_10)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th><th class=\"text-start p-2\">")
if err != nil {
return err
}
var_11 := `Owner (ID/Email)`
_, err = templBuffer.WriteString(var_11)
if err != nil {
return err
}
_, err = templBuffer.WriteString("</th></tr></thead><tbody>")
if err != nil {
return err
}
for _, domain := range domains {
_, err = templBuffer.WriteString("<tr class=\"border\"><td><div class=\"p-2\"><input class=\"border\" value=\"")
if err != nil {
return err
}
_, err = templBuffer.WriteString(templ.EscapeString(domain.Id))
if err != nil {
return err
}
_, err = templBuffer.WriteString("\" disabled></div></td><td><div class=\"p-2\">")
if err != nil {
return err
}
var var_12 string = domain.Domain
_, err = templBuffer.WriteString(templ.EscapeString(var_12))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div></td><td><div class=\"p-2\">")
if err != nil {
return err
}
var var_13 string = domain.A
_, err = templBuffer.WriteString(templ.EscapeString(var_13))
if err != nil {
return err
}
_, err = templBuffer.WriteString("</div></td><td><div class=\"p-2\"><div class=\"flex flex-row-reverse gap-1\"><input class=\"peer\" type=\"checkbox\"><input class=\"border hidden peer-checked:block\" value=\"")
if err != nil {
return err
}
_, err = templBuffer.WriteString(templ.EscapeString(domain.Owner.Email))
if err != nil {
return err
}
_, err = templBuffer.WriteString("\" disabled><input class=\"border block peer-checked:hidden\" value=\"")
if err != nil {
return err
}
_, err = templBuffer.WriteString(templ.EscapeString(domain.Owner.ID))
if err != nil {
return err
}
_, err = templBuffer.WriteString("\" disabled></div></div></td></tr>")
if err != nil {
return err
}
}
_, err = templBuffer.WriteString("</tbody></table>")
if err != nil {
return err
}
if !templIsBuffer {
_, err = templBuffer.WriteTo(w)
}
return err
})
}