passing dependencies as props and rendering them in IssueDetail instead of lazy-loading via hx-get
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user