This repository has no description
1<script lang="ts">
2 import SquareChartGantt from "$icon/square-chart-gantt";
3 import CircleDot from "$icon/circle-dot";
4 import GitPullRequest from "$icon/git-pull-request";
5 import Layers2 from "$icon/layers-2";
6 import Settings from "$icon/settings";
7 import Tabs, { type TabDef } from "$lib/components/ui/Tabs.svelte";
8 import type { RepoCounts, RepoInfo } from "./types";
9
10 interface Props {
11 repo: RepoInfo;
12 counts: RepoCounts;
13 active: string;
14 }
15
16 let { repo, counts, active }: Props = $props();
17
18 const base = $derived(`/${repo.ownerHandle}/${repo.name}`);
19
20 const tabs = $derived<TabDef[]>([
21 { id: "overview", label: "Overview", icon: SquareChartGantt, href: base },
22 {
23 id: "issues",
24 label: "Issues",
25 icon: CircleDot,
26 count: counts.issues,
27 href: `${base}/issues`
28 },
29 {
30 id: "pulls",
31 label: "Pulls",
32 icon: GitPullRequest,
33 count: counts.pulls,
34 href: `${base}/pulls`
35 },
36 { id: "pipelines", label: "Pipelines", icon: Layers2, href: `${base}/pipelines` },
37 // todo: only show this to collaborators — needs the viewer's push access on
38 // RepoInfo, which the layout load doesn't resolve yet
39 { id: "settings", label: "Settings", icon: Settings, href: `${base}/settings` }
40 ]);
41</script>
42
43<Tabs {tabs} {active} label="repository sections" />