{{ define "repo/pulls/fragments/pullHeader" }}

{{ .Pull.Title | description }} #{{ .Pull.PullId }}

{{ $bgColor := "bg-gray-800 dark:bg-gray-700" }} {{ $icon := "ban" }} {{ if .Pull.State.IsOpen }} {{ $bgColor = "bg-green-600 dark:bg-green-700" }} {{ $icon = "git-pull-request" }} {{ else if .Pull.State.IsMerged }} {{ $bgColor = "bg-purple-600 dark:bg-purple-700" }} {{ $icon = "git-merge" }} {{ end }}
{{ i $icon "w-4 h-4 mr-1.5 text-white" }} {{ .Pull.State.String }}
opened by {{ template "user/fragments/picHandleLink" .Pull.OwnerDid }} {{ template "repo/fragments/time" .Pull.Created }} targeting {{ .Pull.TargetBranch }} {{ if not .Pull.IsPatchBased }} from {{ if .Pull.IsForkBased }} {{ if .Pull.PullSource.Repo }} {{ $owner := resolve .Pull.PullSource.Repo.Did }} {{ $owner }}/{{ .Pull.PullSource.Repo.Name }}: {{- else -}} [deleted fork] {{- end -}} {{- end -}} {{- .Pull.PullSource.Branch -}} {{ end }}
{{ if .Pull.Body }}
{{ .Pull.Body | markdown }}
{{ end }} {{ with .OrderedReactionKinds }}
{{ template "repo/fragments/reactionsPopUp" . }} {{ range $kind := . }} {{ $reactionData := index $.Reactions $kind }} {{ template "repo/fragments/reaction" (dict "Kind" $kind "Count" $reactionData.Count "IsReacted" (index $.UserReacted $kind) "ThreadAt" $.Pull.PullAt "Users" $reactionData.Users) }} {{ end }}
{{ end }}
{{ end }}