2024-12-10 23:41:49 -05:00
|
|
|
// Code generated by templ - DO NOT EDIT.
|
|
|
|
|
|
|
|
// templ: version: v0.2.793
|
2024-12-22 17:01:11 -05:00
|
|
|
package islands
|
2024-12-10 23:41:49 -05:00
|
|
|
|
|
|
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
|
|
|
|
|
|
|
import "github.com/a-h/templ"
|
|
|
|
import templruntime "github.com/a-h/templ/runtime"
|
|
|
|
|
2024-12-11 15:11:24 -05:00
|
|
|
type HandleState string
|
2024-12-10 23:41:49 -05:00
|
|
|
|
|
|
|
const (
|
2024-12-11 15:11:24 -05:00
|
|
|
HandleStateInitial HandleState = "inital"
|
|
|
|
HandleStateValid HandleState = "valid"
|
|
|
|
HandleStateInvalid HandleState = "invalid"
|
2024-12-10 23:41:49 -05:00
|
|
|
)
|
|
|
|
|
2024-12-11 15:11:24 -05:00
|
|
|
func (s HandleState) string() string {
|
2024-12-10 23:41:49 -05:00
|
|
|
return string(s)
|
|
|
|
}
|
|
|
|
|
2024-12-22 17:01:11 -05:00
|
|
|
func InputHandle() templ.Component {
|
2024-12-10 23:41:49 -05:00
|
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
|
|
|
return templ_7745c5c3_CtxErr
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
|
|
|
if !templ_7745c5c3_IsBuffer {
|
|
|
|
defer func() {
|
|
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
if templ_7745c5c3_Err == nil {
|
|
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
|
|
|
if templ_7745c5c3_Var1 == nil {
|
|
|
|
templ_7745c5c3_Var1 = templ.NopComponent
|
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
2024-12-22 17:01:11 -05:00
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div hx-target=\"this\" hx-swap=\"outerHTML\"><sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required hx-post=\"/register/profile\" hx-indicator=\"#handle-indicator\" autofocus><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input></div><br>")
|
2024-12-10 23:41:49 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-12-22 17:01:11 -05:00
|
|
|
func InputHandleError(value string, helpText string) templ.Component {
|
2024-12-11 11:36:52 -05:00
|
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
|
|
|
return templ_7745c5c3_CtxErr
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
|
|
|
if !templ_7745c5c3_IsBuffer {
|
|
|
|
defer func() {
|
|
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
if templ_7745c5c3_Err == nil {
|
|
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
|
|
|
templ_7745c5c3_Var2 := templ.GetChildren(ctx)
|
|
|
|
if templ_7745c5c3_Var2 == nil {
|
|
|
|
templ_7745c5c3_Var2 = templ.NopComponent
|
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
2024-12-16 15:29:54 -05:00
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required class=\"border-red-500\" value=\"")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var3 string
|
|
|
|
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(value)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
2024-12-28 18:08:59 -05:00
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/input_handle.templ`, Line: 27, Col: 152}
|
2024-12-16 15:29:54 -05:00
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
2024-12-18 15:53:45 -05:00
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" help-text=\"")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
var templ_7745c5c3_Var4 string
|
|
|
|
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(helpText)
|
|
|
|
if templ_7745c5c3_Err != nil {
|
2024-12-28 18:08:59 -05:00
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/input_handle.templ`, Line: 27, Col: 175}
|
2024-12-18 15:53:45 -05:00
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
2024-12-16 15:29:54 -05:00
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><div slot=\"prefix\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div><div slot=\"suffix\" style=\"color: #B54549;\"><sl-icon name=\"x\"></sl-icon></div></sl-input><br>")
|
2024-12-11 11:36:52 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-12-22 17:01:11 -05:00
|
|
|
func InputHandleSuccess(value string) templ.Component {
|
2024-12-11 11:36:52 -05:00
|
|
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
|
|
|
return templ_7745c5c3_CtxErr
|
|
|
|
}
|
|
|
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
|
|
|
if !templ_7745c5c3_IsBuffer {
|
|
|
|
defer func() {
|
|
|
|
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
|
|
|
if templ_7745c5c3_Err == nil {
|
|
|
|
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
ctx = templ.InitializeContext(ctx)
|
2024-12-18 15:53:45 -05:00
|
|
|
templ_7745c5c3_Var5 := templ.GetChildren(ctx)
|
|
|
|
if templ_7745c5c3_Var5 == nil {
|
|
|
|
templ_7745c5c3_Var5 = templ.NopComponent
|
2024-12-11 11:36:52 -05:00
|
|
|
}
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
2024-12-16 15:29:54 -05:00
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<sl-input name=\"handle\" placeholder=\"digitalgold\" type=\"text\" label=\"Handle\" minlength=\"4\" maxlength=\"12\" required class=\"border-green-500\" value=\"")
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
2024-12-18 15:53:45 -05:00
|
|
|
var templ_7745c5c3_Var6 string
|
|
|
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(value)
|
2024-12-16 15:29:54 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
2024-12-28 18:08:59 -05:00
|
|
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `gateway/islands/input_handle.templ`, Line: 39, Col: 154}
|
2024-12-16 15:29:54 -05:00
|
|
|
}
|
2024-12-18 15:53:45 -05:00
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
2024-12-16 15:29:54 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" disabled><div slot=\"prefix\" style=\"color: #46A758;\"><sl-icon name=\"at-sign\" library=\"sonr\"></sl-icon></div></sl-input><br>")
|
2024-12-11 11:36:52 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
}
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-12-10 23:41:49 -05:00
|
|
|
var _ = templruntime.GeneratedTemplate
|