{{ define "card-grid" }} {{/* Card grid component - displays repository cards in a responsive grid Required: - .Repositories: []db.RepoCardData - list of repositories to display Optional: - .Columns: int - number of columns on xl screens (3 or 4, default 3) - .EmptyMessage: string - message when no repositories (default: "No repositories found.") - .EmptyIcon: string - lucide icon name for empty state - .EmptySubtext: string - secondary text for empty state - .LoadMoreURL: string - URL for Load More button (HTMX) - .TargetID: string - HTMX target ID for Load More - .HasMore: bool - whether to show Load More button */}} {{ if .Repositories }} {{ range .Repositories }} {{ template "repo-card" . }} {{ end }} {{ if and .HasMore .LoadMoreURL .TargetID }}
{{ end }} {{ else }}
{{ if .EmptyIcon }}
{{ icon .EmptyIcon "size-12 mx-auto mb-4" }}

{{ or .EmptyMessage "No repositories found." }}

{{ else }}

{{ or .EmptyMessage "No repositories found." }}

{{ end }} {{ if .EmptySubtext }}

{{ .EmptySubtext }}

{{ end }}
{{ end }} {{ end }} {{/* card-grid-append — response fragment for Load More pagination. Emits the new page's cards OOB-swapped into #{{ .TargetID }} and replaces the existing #{{ .TargetID }}-lm button wrapper via the primary outerHTML swap. When .HasMore is false, the button wrapper is replaced with an empty div, removing the Load More control. */}} {{ define "card-grid-append" }}
{{ range .Repositories }} {{ template "repo-card" . }} {{ end }}
{{ if and .HasMore .LoadMoreURL }}
{{ else }}
{{ end }} {{ end }}