{{if .Items}}
{{range .Items}}
<a href="/admin/review/{{.Version.ID}}" class="block px-6 py-4 hover:bg-gray-50 transition-colors">
  <div class="flex items-center justify-between">
    <div class="flex items-center min-w-0">
      <div class="w-10 h-10 bg-gray-100 rounded-lg flex items-center justify-center flex-shrink-0">
        <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/>
        </svg>
      </div>
      <div class="ml-4 min-w-0">
        <p class="text-sm font-medium text-gray-900 truncate">{{.App.Name}}</p>
        <p class="text-sm text-gray-500 truncate">{{.App.PackageID}} - v{{.Version.VersionName}}</p>
      </div>
    </div>
    <div class="flex items-center space-x-4">
      <div class="text-right">
        <p class="text-sm text-gray-500">{{.DeveloperName}}</p>
        <p class="text-xs text-gray-400">{{.Version.CreatedAt.Format "Jan 2, 2006"}}</p>
      </div>
      <span class="px-2 py-1 text-xs font-medium rounded bg-yellow-100 text-yellow-800">In Review</span>
      <svg class="w-5 h-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
      </svg>
    </div>
  </div>
</a>
{{end}}

{{if gt .Pagination.TotalPages 1}}
<div class="px-6 py-4 border-t border-gray-200 flex items-center justify-between">
  <p class="text-sm text-gray-500">
    Showing {{add (mul (sub .Pagination.Page 1) .Pagination.Limit) 1}} to {{min (mul .Pagination.Page .Pagination.Limit) .Pagination.Total}} of {{.Pagination.Total}} results
  </p>
  <div class="flex space-x-2">
    {{if gt .Pagination.Page 1}}
    <button
      hx-get="/admin/partials/review-queue?page={{sub .Pagination.Page 1}}"
      hx-target="#review-queue"
      class="px-3 py-1 text-sm border border-gray-300 rounded hover:bg-gray-50">
      Previous
    </button>
    {{end}}
    {{if lt .Pagination.Page .Pagination.TotalPages}}
    <button
      hx-get="/admin/partials/review-queue?page={{add .Pagination.Page 1}}"
      hx-target="#review-queue"
      class="px-3 py-1 text-sm border border-gray-300 rounded hover:bg-gray-50">
      Next
    </button>
    {{end}}
  </div>
</div>
{{end}}
{{else}}
<div class="px-6 py-12 text-center">
  <svg class="w-12 h-12 text-gray-300 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
  </svg>
  <p class="text-gray-500">No apps pending review.</p>
  <p class="text-sm text-gray-400 mt-1">All caught up!</p>
</div>
{{end}}
