import type { FileIconName } from "@/shared/web"; import { Breadcrumbs } from "@/client/components/Breadcrumbs"; import { EmptyState } from "@/client/components/EmptyState"; import { FileIcon } from "@/client/components/FileIcon"; import { type Progress, ProgressBanner } from "@/client/components/ProgressBanner"; import { RepoNav } from "@/client/components/RepoNav"; type TreeEntry = { name: string; href: string; isDir: boolean; isSymlink: boolean; iconName: FileIconName; shortOid: string; }; type Breadcrumb = { name: string; href: string | null; }; export type TreePageProps = { owner: string; repo: string; refEnc: string; entries: TreeEntry[]; breadcrumbs?: Breadcrumb[]; parentHref?: string | null; progress?: Progress; }; function getTreeEntryIconClass(entry: TreeEntry): string { if (entry.isDir) { return "text-amber-600 dark:text-amber-400"; } if (entry.isSymlink) { return "text-accent-500 dark:text-accent-400"; } return "text-zinc-500 dark:text-zinc-400"; } export function TreePage({ owner, repo, refEnc, entries, breadcrumbs, parentHref, progress, }: TreePageProps) { return ( <>
Browse

Tree

{entries.length ? ( entries.map((entry) => ( )) ) : ( )}
Name OID
{" "} {entry.name} {entry.shortOid}
} title="This tree is empty" />
); }