{{ define "title" }}{{ or .UserHandle .UserDid }}{{ end }} {{ define "content" }}
{{ block "profileCard" . }}{{ end }}
{{ block "ownRepos" . }}{{ end }} {{ block "collaboratingRepos" . }}{{ end }}
{{ block "profileTimeline" . }}{{ end }}
{{ end }} {{ define "profileTimeline" }}

ACTIVITY

{{ range .ProfileTimeline }} {{ if eq .Type "issue" }}
{{ $textColor := "text-gray-800 dark:text-gray-400" }} {{ $icon := "ban" }} {{ if .Issue.Open }} {{ $textColor = "text-green-600 dark:text-green-500" }} {{ $icon = "circle-dot" }} {{ end }}
{{ i $icon "w-5 h-5" }}

{{ .Issue.Title }} #{{ .Issue.IssueId }} on {{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}

{{ else if eq .Type "pull" }}
{{ $textColor := "text-gray-800 dark:text-gray-400" }} {{ $icon := "git-pull-request-closed" }} {{ if .Pull.State.IsOpen }} {{ $textColor = "text-green-600 dark:text-green-500" }} {{ $icon = "git-pull-request" }} {{ else if .Pull.State.IsMerged }} {{ $textColor = "text-purple-600 dark:text-purple-500" }} {{ $icon = "git-merge" }} {{ end }}
{{ i $icon "w-5 h-5" }}

{{ .Pull.Title }} #{{ .Pull.PullId }} on {{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}

{{ else if eq .Type "repo" }}
{{ if .Source }}
{{ i "git-fork" "w-5 h-5" }}
{{ else }}
{{ i "book-plus" "w-5 h-5" }}
{{ end }}

{{ if .Source }} forked {{ index $.DidHandleMap .Source.Did }}/{{ .Source.Name }} to {{ .Repo.Name }} {{ else }} created {{ .Repo.Name }} {{ end }}

{{ end }} {{ else }}

This user does not have any activity yet.

{{ end }}
{{ end }} {{ define "profileCard" }}
{{ if .AvatarUri }} {{ end }}

{{ didOrHandle .UserDid .UserHandle }}

{{ .ProfileStats.Followers }} followers
{{ .ProfileStats.Following }} following
{{ if ne .FollowStatus.String "IsSelf" }} {{ template "fragments/follow" . }} {{ end }}
{{ end }} {{ define "ownRepos" }}

REPOS

{{ range .Repos }}
{{ if .Description }}
{{ .Description }}
{{ end }}
{{ if .RepoStats.StarCount }}
{{ i "star" "w-3 h-3 fill-current" }} {{ .RepoStats.StarCount }}
{{ end }}
{{ else }}

This user does not have any repos yet.

{{ end }}

COLLABORATING ON

{{ range .CollaboratingRepos }}
{{ if .Description }}
{{ .Description }}
{{ end }}
{{ if .RepoStats.StarCount }}
{{ i "star" "w-3 h-3 fill-current" }} {{ .RepoStats.StarCount }}
{{ end }}
{{ else }}

This user is not collaborating.

{{ end }}
{{ end }}