package templates import ( g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" base "alin.ovh/homestead/domain/web/templates" ) type PageSettings struct { User string IsLoggedIn bool base.PageSettings } func IndexPage(site base.SiteSettings, page PageSettings) g.Node { return Layout(site, page.PageSettings, Div( H1(g.Textf("Welcome, %s!", page.User)), g.If(page.IsLoggedIn, Div( P(g.Text("You are currently logged in.")), P( A( g.Attr("href", "/admin/auth/logout"), g.Text("Logout"), ), ), ), ), g.If(!page.IsLoggedIn, Div( P(g.Text("Please log in to access protected features.")), P( A( g.Attr("href", "/admin/auth/login"), g.Text("Login"), ), ), ), ), ), ) }