Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
Svelte
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364<script lang="ts"> import EmptyState from "$lib/components/ui/EmptyState.svelte"; import Pagination from "$lib/components/ui/Pagination.svelte"; import type { CommitStatuses } from "$lib/api/commitStatuses"; import CommitRows from "$lib/components/repo/CommitRows.svelte"; import CommitRow from "$lib/components/repo/CommitRow.svelte"; import type { CommitSummary } from "$lib/components/repo/types"; import Card from "$lib/components/ui/Card.svelte"; import GitCommitVertical from "$icon/git-commit-vertical";
interface Props { ownerHandle: string; repoName: string; ref: string; commits: CommitSummary[]; tagsByCommit?: Record<string, string[]> | Promise<Record<string, string[]>>; pipelineStatuses?: Promise<CommitStatuses>; page: number; pageCount: number; onPageChange?: (page: number) => void; }
let { ownerHandle, repoName, ref, commits, tagsByCommit, pipelineStatuses, page, pageCount, onPageChange }: Props = $props();</script>
<Card padding="none"> {#if commits.length === 0} <EmptyState size="inline" message="No commits at {ref}." class="justify-center py-xl" /> {:else} <h2 class="flex flex-wrap items-center gap-xs p-md typography-paragraph-regular font-medium" > <GitCommitVertical class="size-3.5 shrink-0" aria-hidden="true" /> Commits on <span class="flex min-w-0 rounded-sm bg-background-inset px-2xs typography-monospace-regular font-normal text-foreground-default" >{ref}</span > </h2>
<CommitRows class="divide-y divide-border-default border-t border-border-default"> {#each commits as commit (commit.hash)} <CommitRow {ownerHandle} {repoName} {commit} {tagsByCommit} {pipelineStatuses} /> {/each} </CommitRows> {/if}</Card>
{#if pageCount > 1} <div class="mt-md flex justify-center"> <Pagination {page} total={pageCount} labels onchange={onPageChange} class="gap-lg" /> </div>{/if}