{{ define "repo/issues/fragments/issueCommentHeader" }}
{{ $handle := resolve .Comment.Did }} {{ $handle }} {{ template "hats" $ }} {{ template "timestamp" . }} {{ $isCommentOwner := and .LoggedInUser (eq .LoggedInUser.Did .Comment.Did) }} {{ if and $isCommentOwner (not .Comment.Deleted) }} {{ template "editIssueComment" . }} {{ template "deleteIssueComment" . }} {{ 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 "editIssueComment" }} {{ i "pencil" "size-3" }} {{ end }} {{ define "deleteIssueComment" }} {{ i "trash-2" "size-3" }} {{ i "loader-circle" "size-3 animate-spin hidden group-[.htmx-request]:inline" }} {{ end }}