htmgo/examples/todo-list/pages/index.go
maddalax 8736c00fd5
htmgo - custom formatter (#47)
* format htmgo elements on save

* formatter updates

* ensure we maintain comments
2024-10-25 10:33:48 -05:00

34 lines
599 B
Go

package pages
import (
"todolist/pages/base"
"todolist/partials/task"
"github.com/maddalax/htmgo/framework/h"
)
func TaskListPage(ctx *h.RequestContext) *h.Page {
title := h.Div(
h.H1(
h.Class("text-7xl font-extralight text-rose-500 tracking-wide"),
h.Text("todos"),
),
)
return h.NewPage(base.RootPage(
h.Div(
h.Class("bg-neutral-100 min-h-screen"),
h.Div(
h.Class("flex flex-col gap-6 p-4 items-center max-w-xl mx-auto pb-12"),
title,
task.Card(ctx),
h.Children(
h.Div(
h.Text("Double-click to edit a todo"),
),
),
),
),
))
}