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<button
17 id="vouch-btn-{{ normalizeForHtmlId $userDid }}"
18 type="button"
19 popovertarget="vouch-modal-{{ normalizeForHtmlId $userDid }}"
20 popovertargetaction="toggle"
21 class="{{ if $isVouched }}btn-create{{else if $isDenounced}}btn-cancel{{else}}btn{{end}} w-full flex gap-2 items-center justify-center">
22 {{ if $isVouched }}
23 {{ i "shield-check" "size-4" }} vouched
24 {{ else if $isDenounced }}
25 {{ i "shield-off" "size-4" }} denounced
26 {{ else }}
27 {{ i "shield-question-mark" "size-4" }} vouch
28 {{ end }}
29</button>
30{{ end }}