{{ define "title" }}forks · {{ .RepoInfo.FullName }}{{ end }}
  {{ define "repoContent" }}
  <div class="flex flex-col gap-4">
    <h2 class="text-sm uppercase font-bold">Forked by</h2>
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
      {{ range .Forks }}
        <div class="border border-gray-200 dark:border-gray-700 rounded p-4">
          {{ template "forkOwnerAndName" . }}
        </div>
      {{ end }}
      {{ if eq .TotalCount 0 }}
        <p class="text-gray-500 dark:text-gray-400 col-span-3">No forks yet.</p>
      {{ end }}
    </div>
    {{ if gt .TotalCount .Page.Limit }}
      {{ template "fragments/pagination" (dict
          "Page" .Page
          "TotalCount" .TotalCount
          "BasePath" (printf "/%s/forks" .RepoInfo.FullName)
          "QueryParams" (queryParams)
      ) }}
    {{ end }}
  </div>
{{ end }}

{{ define "forkOwnerAndName" }}
  {{ $repoOwner := resolve .Did }}
  <div class="flex items-center gap-3">
    {{ template "user/fragments/picLink" (list .Did "size-10") }}
    <div class="flex-1 min-w-0">
      <div class="flex items-center gap-1 truncate">
        <a href="/{{ $repoOwner }}" class="truncate">{{ $repoOwner }}</a>
        <span class="select-none">/</span>
        <a href="/{{ $repoOwner }}/{{ .Name }}" class="truncate">{{ .Name }}</a>
      </div>
      <p class="text-sm text-gray-500 dark:text-gray-400">
        forked {{ .Created | relTimeFmt }}
      </p>
    </div>
  </div>
{{ end }}
