// Code generated by templ - DO NOT EDIT. // templ: version: v0.3.1020 package templates //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" import "bookhoard/internal/handlers" func Devices(user User, devices []handlers.DeviceInfo, errorMessage string, baseURL string) templ.Component { 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) templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
Manage your reading devices and sync settings
Add your reading devices to enable cross-device sync
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(device.DeviceType) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `devices.templ`, Line: 72, Col: 89} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "
Device Sync Configuration
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if device.DeviceType == "kobo" { templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "Paste this URL into Kobo's api_endpoint setting
Enter this token in the KOReader plugin settings
Old token will immediately stop working
On your e-reader, open the Bookhoard sync menu and tap Register device — then enter the 6-digit code it shows below. Only someone holding the device can see the code, so nobody else can claim (or interfere with) your registration.
plugins/ directory")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var17 string
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(baseURL)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `devices.templ`, Line: 221, Col: 148}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, " Loading mappings...
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var21 string templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(deviceType) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `devices.templ`, Line: 464, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, " device · Pair it with your account? Its reading progress will sync here.
No waiting device matches that code — check the digits on your e-reader's screen.
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if status == "expired" { templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "That code expired. Tap Register device on the device again for a fresh one.
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if status == "claimed" { templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "That code was already used. If the device isn't listed above, register it again from the device.
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } else if status == "rate_limited" { templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "Too many pairing attempts — wait a minute and try again.
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } return nil }) } var _ = templruntime.GeneratedTemplate