2026-01-05 13:57:12 -05:00
|
|
|
// Code generated by templ - DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
// templ: version: v0.3.977
|
|
|
|
|
package layouts
|
|
|
|
|
|
|
|
|
|
//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"
|
|
|
|
|
|
2026-01-05 15:39:40 -05:00
|
|
|
import "nebula/components"
|
|
|
|
|
|
2026-01-05 13:57:12 -05:00
|
|
|
type WalletUser struct {
|
|
|
|
|
Name string
|
|
|
|
|
Address string
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-05 18:41:05 -05:00
|
|
|
// DashboardLayout renders the dashboard using wa-page component
|
2026-01-05 15:39:40 -05:00
|
|
|
func DashboardLayout(title string, user WalletUser, activeTab string) templ.Component {
|
2026-01-05 13:57:12 -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)
|
|
|
|
|
templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
|
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)
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = pageStyles().Render(ctx, templ_7745c5c3_Buffer)
|
2026-01-05 15:39:40 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " <wa-page mobile-breakpoint=\"920\"><div slot=\"header\"><a href=\"/dashboard\" class=\"header-logo\"><wa-icon name=\"cube\"></wa-icon> <span>Sonr</span></a> <wa-button data-toggle-nav variant=\"neutral\" appearance=\"plain\" class=\"wa-mobile-only\"><wa-icon name=\"bars\"></wa-icon></wa-button>")
|
2026-01-05 13:57:12 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = components.UserDropdown(components.NavUser{Name: user.Name, Address: user.Address}).Render(ctx, templ_7745c5c3_Buffer)
|
2026-01-05 16:17:24 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</div><nav slot=\"navigation\">")
|
2026-01-05 16:17:24 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = components.NavigationItems(activeTab).Render(ctx, templ_7745c5c3_Buffer)
|
2026-01-05 16:17:24 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "</nav><main>")
|
2026-01-05 13:57:12 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</main></wa-page>")
|
2026-01-05 13:57:12 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
templ_7745c5c3_Err = Base(title).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-05 18:41:05 -05:00
|
|
|
// AppLayout is a simplified layout without navigation (for non-dashboard pages)
|
2026-01-05 15:39:40 -05:00
|
|
|
func AppLayout(title string, user WalletUser) templ.Component {
|
2026-01-05 13:57:12 -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_Var3 := templ.GetChildren(ctx)
|
|
|
|
|
if templ_7745c5c3_Var3 == nil {
|
|
|
|
|
templ_7745c5c3_Var3 = templ.NopComponent
|
|
|
|
|
}
|
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
2026-01-05 15:39:40 -05:00
|
|
|
templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
|
|
|
|
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
|
|
|
|
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)
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = pageStyles().Render(ctx, templ_7745c5c3_Buffer)
|
2026-01-05 15:39:40 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, " <wa-page><!-- Header: Logo + User Avatar --><div slot=\"header\"><a href=\"/dashboard\" class=\"header-logo\"><wa-icon name=\"cube\"></wa-icon> <span>Sonr</span></a>")
|
2026-01-05 15:39:40 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = components.UserDropdown(components.NavUser{Name: user.Name, Address: user.Address}).Render(ctx, templ_7745c5c3_Buffer)
|
2026-01-05 15:39:40 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</div><!-- Main Content --><main>")
|
2026-01-05 15:39:40 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer)
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
2026-01-05 18:41:05 -05:00
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</main></wa-page>")
|
2026-01-05 15:39:40 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
templ_7745c5c3_Err = Base(title).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer)
|
2026-01-05 13:57:12 -05:00
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-05 18:41:05 -05:00
|
|
|
func pageStyles() 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_Var5 := templ.GetChildren(ctx)
|
|
|
|
|
if templ_7745c5c3_Var5 == nil {
|
|
|
|
|
templ_7745c5c3_Var5 = templ.NopComponent
|
|
|
|
|
}
|
|
|
|
|
ctx = templ.ClearChildren(ctx)
|
|
|
|
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<style>\n\t\t/* Header Logo */\n\t\t.header-logo {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--wa-space-s);\n\t\t\ttext-decoration: none;\n\t\t\tcolor: var(--wa-color-neutral-900);\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: var(--wa-font-size-l);\n\t\t}\n\t\t\n\t\t.header-logo wa-icon {\n\t\t\tfont-size: 24px;\n\t\t\tcolor: var(--wa-color-primary);\n\t\t}\n\t\t\n\t\t/* Navigation Items */\n\t\t.nav-item {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--wa-space-s);\n\t\t\tpadding: var(--wa-space-s) var(--wa-space-m);\n\t\t\tborder-radius: var(--wa-radius-m);\n\t\t\tcolor: var(--wa-color-neutral-600);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: var(--wa-font-size-s);\n\t\t\tfont-weight: 500;\n\t\t\ttransition: all 0.15s ease;\n\t\t}\n\t\t\n\t\t.nav-item:hover {\n\t\t\tbackground: var(--wa-color-neutral-100);\n\t\t\tcolor: var(--wa-color-neutral-900);\n\t\t}\n\t\t\n\t\t.nav-item.active {\n\t\t\tbackground: var(--wa-color-primary-subtle);\n\t\t\tcolor: var(--wa-color-primary);\n\t\t}\n\t\t\n\t\t.nav-item wa-icon {\n\t\t\tfont-size: 18px;\n\t\t}\n\t\t\n\t\t/* Navigation Section */\n\t\t.nav-section {\n\t\t\tmargin-top: var(--wa-space-l);\n\t\t\tpadding-top: var(--wa-space-l);\n\t\t\tborder-top: 1px solid var(--wa-color-neutral-200);\n\t\t}\n\t\t\n\t\t.nav-section-title {\n\t\t\tpadding: var(--wa-space-xs) var(--wa-space-m);\n\t\t\tfont-size: var(--wa-font-size-xs);\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--wa-color-neutral-500);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.05em;\n\t\t}\n\t\t\n\t\t/* User Menu */\n\t\t.user-menu-header {\n\t\t\tpadding: var(--wa-space-m) var(--wa-space-l);\n\t\t}\n\t\t\n\t\t.user-menu-header strong {\n\t\t\tdisplay: block;\n\t\t\tfont-size: var(--wa-font-size-s);\n\t\t\tcolor: var(--wa-color-neutral-900);\n\t\t}\n\t\t\n\t\t.user-menu-header span {\n\t\t\tfont-size: var(--wa-font-size-xs);\n\t\t\tcolor: var(--wa-color-neutral-500);\n\t\t\tfont-family: var(--wa-font-mono);\n\t\t}\n\t\t\n\t\t/* Page customizations */\n\t\twa-page {\n\t\t\t--menu-width: 240px;\n\t\t}\n\t\t\n\t\twa-page[view='mobile'] {\n\t\t\t--menu-width: auto;\n\t\t}\n\t\t\n\t\t/* Main content padding */\n\t\twa-page main {\n\t\t\tpadding: var(--wa-space-l);\n\t\t\tbackground: var(--wa-color-surface-alt);\n\t\t\tmin-height: 100%;\n\t\t}\n\t</style>")
|
|
|
|
|
if templ_7745c5c3_Err != nil {
|
|
|
|
|
return templ_7745c5c3_Err
|
|
|
|
|
}
|
|
|
|
|
return nil
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-05 13:57:12 -05:00
|
|
|
var _ = templruntime.GeneratedTemplate
|