{{ define "repo/fragments/reactions" }}
{{- $reactions := .Reactions -}} {{- $userReacted := .UserReacted -}} {{- $threadAt := .ThreadAt -}} {{- $parts := splitOn (string $threadAt) "/" -}} {{- $commentRkey := index $parts (sub (len $parts) 1) -}} {{ range $kind := const.OrderedReactionKinds }} {{ $reactionData := index $reactions $kind }} {{ template "repo/fragments/reaction" (dict "Kind" $kind "Count" $reactionData.Count "IsReacted" (index $userReacted $kind) "Users" $reactionData.Users "CommentRkey" $commentRkey "SubjectUri" $threadAt) }} {{ end }} {{ if or (not .HideIfEmpty) (gt (len $reactions) 0) }} {{ template "repo/fragments/reactionsPopup" (dict "CommentRkey" $commentRkey "Scope" "body") }} {{ end }}
{{ end }}