This repository has no description
1{{ define "user/fragments/follow" }}
2 <button id="{{ normalizeForHtmlId .UserDid }}"
3 class="btn w-full flex gap-2 items-center group"
4
5 data-follow-subject="{{ .UserDid }}"
6 {{ if .HxSwapOob }}hx-swap-oob='outerHTML:[data-follow-subject="{{ .UserDid }}"]'{{ end }}
7
8 {{ if eq .FollowStatus.String "IsNotFollowing" }}
9 hx-post="/follow?subject={{.UserDid}}"
10 {{ else }}
11 hx-delete="/follow?subject={{.UserDid}}"
12 {{ end }}
13
14 hx-trigger="click"
15 hx-target="#{{ normalizeForHtmlId .UserDid }}"
16 hx-swap="none"
17 hx-disabled-elt="this"
18 >
19 {{ if eq .FollowStatus.String "IsNotFollowing" }}
20 {{ i "user-round-plus" "size-4 inline group-[.htmx-request]:hidden" }}
21 {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }}
22 Follow
23 {{ else }}
24 {{ i "user-round-minus" "size-4 inline group-[.htmx-request]:hidden" }}
25 {{ i "loader-circle" "size-4 animate-spin hidden group-[.htmx-request]:inline" }}
26 Unfollow
27 {{ end }}
28 </button>
29{{ end }}