package components
templ Index() {
@Base("emerwen, counting sheep") {
<div class="flex flex-col gap-2">
if loggedIn(ctx) {
@newWorker()
<div hx-get="/partials/workers" hx-trigger="load, refresh-workers from:body" hx-target="this"></div>
}
</div>
}
}
templ newWorker() {
<details>
<summary class="select-none">new worker</summary>
<form class="flex flex-col p-2 gap-1" hx-post="/api/worker">
<label>name</label>
<input class="border" type="text" placeholder="..." name="name"/>
<button class="border p-1" type="submit">add</button>
</form>
</details>
}