This repository has no description
1{{ define "user/fragments/vouchButton" }}
2{{ $isVouched := false }}
3{{ $isDenounced := false }}
4{{ if .VouchRelationship }}
5 {{ if .VouchRelationship.IsDirectVouch }}
6 {{ $isVouched = true }}
7 {{ else if .VouchRelationship.IsDirectDenounce }}
8 {{ $isDenounced = true }}
9 {{ end }}
10{{ end }}
11
12{{ $userDid := "" }}
13{{ with .VouchRelationship }}
14 {{ $userDid = .SubjectDid.String }}
15{{ end }}
16{{ $popoverId := index . "PopoverId" }}
17{{ if not $popoverId }}{{ $popoverId = printf "vouch-modal-%s" (normalizeForHtmlId $userDid) }}{{ end }}
18<button
19 id="vouch-btn-{{ normalizeForHtmlId $userDid }}"
20 type="button"
21 popovertarget="{{ $popoverId }}"
22 popovertargetaction="toggle"
23 class="{{ if $isVouched }}btn-create{{else if $isDenounced}}btn-cancel{{else}}btn{{end}} w-full flex gap-2 items-center justify-center">
24 {{ if $isVouched }}
25 {{ i "shield-check" "size-4" }} Vouched
26 {{ else if $isDenounced }}
27 {{ i "shield-off" "size-4" }} Denounced
28 {{ else }}
29 {{ i "shield-question-mark" "size-4" }} Vouch
30 {{ end }}
31</button>
32{{ end }}