Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
Svelte
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162<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 TabPanel from "$lib/components/ui/TabPanel.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>
<TabPanel padded={false}> {#if commits.length === 0} <EmptyState size="inline" message="No commits at {ref}." class="justify-center py-6" /> {:else} <h2 class="flex flex-wrap items-center gap-2 p-4 typography-paragraph-regular font-medium"> <GitCommitVertical class="size-4 shrink-0" aria-hidden="true" /> Commits on <span class="flex min-w-0 rounded-sm bg-background-inset px-1 typography-monospace-regular 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}</TabPanel>
{#if pageCount > 1} <div class="mt-4 flex justify-center"> <Pagination {page} total={pageCount} labels onchange={onPageChange} class="gap-5" /> </div>{/if}