{{ define "fragments/comment/commentHeader" }}
{{ $handle := resolve .Comment.Did.String }} {{ $handle }} {{ template "hats" $ }} {{ template "timestamp" . }} {{ $isCommentOwner := and .LoggedInUser (eq .LoggedInUser.Did .Comment.Did.String) }} {{ if and $isCommentOwner (not .Comment.Deleted) }} {{ if not .Comment.IsLegacy }} {{ template "editCommentBtn" . }} {{ end }} {{ template "deleteCommentBtn" . }} {{ end }}
{{ end }} {{ define "hats" }} {{ $isIssueAuthor := eq .Comment.Did .Issue.Did }} {{ if $isIssueAuthor }} (author) {{ end }} {{ end }} {{ define "timestamp" }} {{ if .Comment.Deleted }} {{ template "repo/fragments/shortTimeAgo" .Comment.Deleted }} {{ else if .Comment.Edited }} Edited {{ template "repo/fragments/shortTimeAgo" .Comment.Edited }} {{ else }} {{ template "repo/fragments/shortTimeAgo" .Comment.Created }} {{ end }} {{ end }} {{ define "editCommentBtn" }} {{ i "pencil" "size-3 inline group-[.htmx-request]:hidden" }} {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} {{ end }} {{ define "deleteCommentBtn" }} {{ i "trash-2" "size-3 inline group-[.htmx-request]:hidden" }} {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} {{ end }}