forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "user/fragments/follow" }}
2 <button id="followBtn"
3 class="btn mt-2 w-full flex gap-2 items-center group"
4
5 {{ if eq .FollowStatus.String "IsNotFollowing" }}
6 hx-post="/follow?subject={{.UserDid}}"
7 {{ else }}
8 hx-delete="/follow?subject={{.UserDid}}"
9 {{ end }}
10
11 hx-trigger="click"
12 hx-target="#followBtn"
13 hx-swap="outerHTML"
14 >
15 {{ if eq .FollowStatus.String "IsNotFollowing" }}Follow{{ else }}Unfollow{{ end }}
16 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
17 </button>
18{{ end }}