passing dependencies as props and rendering them in IssueDetail instead of lazy-loading via hx-get

This commit is contained in:
viljarb
2026-03-23 19:28:50 +01:00
parent 996475d9ed
commit 63cfa3e8b8
4 changed files with 70 additions and 52 deletions

View File

@@ -8,9 +8,15 @@ import (
type IssueDetailProps struct {
Issue *models.Issue
From string // "board" when navigating from board view; passed via hx-vals to child requests
}
templ IssueDetail(props IssueDetailProps) {
<div
if props.From == "board" {
hx-vals='{"from": "board"}'
}
>
<h2 class="text-2xl font-bold m-2">
{ props.Issue.Title }
</h2>
@@ -60,6 +66,7 @@ templ IssueDetail(props IssueDetailProps) {
}
</a>
</div>
</div>
}
templ StatusBadge(status models.Status) {