implement proper sever route handling

This commit is contained in:
Robin Olsen
2026-02-02 14:16:08 +01:00
parent 622e830f6e
commit c69fd84fdd
10 changed files with 290 additions and 35 deletions

View File

@@ -8,7 +8,17 @@ package routes
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
func Index() templ.Component {
import (
"github.com/LazyBachelor/LazyPM/internal/models"
"github.com/LazyBachelor/LazyPM/pkg/web/components"
)
type IndexProps struct {
Issues []*models.Issue
IssueList components.IssueListProps
}
func Index(props IndexProps) 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 {
@@ -45,6 +55,10 @@ func Index() templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = components.IssueList(props.IssueList).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
})
templ_7745c5c3_Err = BaseLayout().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)