summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/index.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/components/index.html b/components/index.html
index 0e58af2..5626dbd 100644
--- a/components/index.html
+++ b/components/index.html
@@ -14,7 +14,17 @@
{{.Text}}
</div>
<div>
- <!-->here we need to iterate through {{.Options}} and make them selectable; ai!<-->
+ {{range $index, $option := .Options}}
+ <button
+ hx-post="/answer"
+ hx-vals='{"selected": "{{$index}}"}'
+ hx-target="#ancestor"
+ hx-swap="outerHTML"
+ class="option-button"
+ >
+ {{$option}}
+ </button>
+ {{end}}
</div>
</div>
</body>