{{ define "title" }}{{ .Issue.Title }} · issue #{{ .Issue.IssueId }} · {{ .RepoInfo.FullName }}{{ end }} {{ define "repoContent" }}

{{ .Issue.Title }} #{{ .Issue.IssueId }}

{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} {{ $icon := "ban" }} {{ if eq .State "open" }} {{ $bgColor = "bg-green-600 dark:bg-green-700" }} {{ $icon = "circle-dot" }} {{ end }}
{{ i $icon "w-4 h-4 mr-1.5 text-white" }} {{ .State }}
opened by {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} {{ $owner }}
{{ if .Issue.Body }}
{{ .Issue.Body | markdown }}
{{ end }}
{{ end }} {{ define "repoAfter" }} {{ if gt (len .Comments) 0 }}
{{ range $index, $comment := .Comments }}
{{ if eq $index 0 }}
{{ else }}
{{ end }} {{ template "fragments/issueComment" (dict "RepoInfo" $.RepoInfo "LoggedInUser" $.LoggedInUser "DidHandleMap" $.DidHandleMap "Issue" $.Issue "Comment" .)}}
{{ end }}
{{ end }} {{ block "newComment" . }} {{ end }} {{ $isIssueAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Issue.OwnerDid) }} {{ $isRepoCollaborator := .RepoInfo.Roles.IsCollaborator }} {{ if or $isIssueAuthor $isRepoCollaborator }} {{ $action := "close" }} {{ $icon := "circle-x" }} {{ $hoverColor := "red" }} {{ if eq .State "closed" }} {{ $action = "reopen" }} {{ $icon = "circle-dot" }} {{ $hoverColor = "green" }} {{ end }}
{{ end }} {{ end }} {{ define "newComment" }} {{ if .LoggedInUser }}
{{ didOrHandle .LoggedInUser.Did .LoggedInUser.Handle }}
{{ else }}
login to join the discussion
{{ end }} {{ end }}