{{define "search/fragments/quick"}}
{{- if .Repos -}}
<div class="bg-white dark:bg-gray-900 border border-t-0 border-gray-200 dark:border-gray-700 rounded-b-md shadow-xl overflow-hidden">
  <div class="max-h-[70vh] overflow-y-auto overscroll-contain divide-y divide-gray-100 dark:divide-gray-700">
    {{ template "search/fragments/quickPage" . }}
  </div>
  {{ template "search/fragments/quickFooter" . }}
</div>
{{- else if .Query -}}
<div class="bg-white dark:bg-gray-900 border border-t-0 border-gray-200 dark:border-gray-700 rounded-b-md shadow-xl overflow-hidden px-4 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
  No results for "{{ .Query }}"
</div>
{{- end -}}
{{end}}

{{define "search/fragments/quickMobile"}}
{{- if .Repos -}}
<div class="flex flex-col flex-1 min-h-0 overscroll-contain">
  <div class="flex-1 overflow-y-auto overscroll-contain [&>*+*]:border-t [&>*+*]:border-gray-200 dark:[&>*+*]:border-gray-700">
    {{ template "search/fragments/quickPage" . }}
  </div>
  {{ template "search/fragments/quickFooter" . }}
</div>
{{- else if .Query -}}
<div class="px-4 py-8 text-center text-sm text-gray-500 dark:text-gray-400">
  No results for "{{ .Query }}"
</div>
{{- end -}}
{{end}}

{{define "search/fragments/quickPage"}}
{{- range .Repos -}}
  {{ template "user/fragments/repoCard" (list $ . true false (dict) true true) }}
{{- end -}}
{{end}}

{{define "search/fragments/quickFooter"}}
<div data-results-footer class="bg-gray-50 dark:bg-gray-800 px-4 py-2 flex justify-between items-center text-sm text-gray-600 dark:text-gray-400 border-t border-gray-100 dark:border-gray-700">
  <span>Showing {{ len .Repos }} of {{ .Total }}</span>
  <a href="/search?q={{ urlquery .Query }}"
     class="flex items-center gap-1 hover:text-gray-600 dark:hover:text-gray-300 no-underline hover:no-underline">
    All results {{ i "arrow-right" "size-4" }}
  </a>
</div>
{{end}}
