1.3 KB46 lines
Blame
1"use client";
2
3import Link from "next/link";
4import { useParams } from "next/navigation";
5import { RingLogo } from "@/app/components/ring-logo";
6import { NavBar } from "@/app/components/ui/navbar";
7import { useAppSwitcherItems } from "@/lib/use-app-switcher";
8
9export function RingNav() {
10 const params = useParams<{ owner?: string; repo?: string }>();
11 const owner = params?.owner;
12 const repo = params?.repo;
13 const appSwitcherItems = useAppSwitcherItems("ring", { owner, repo });
14
15 return (
16 <NavBar
17 logo={<RingLogo size={28} />}
18 productName="Ring"
19 showProductName={!owner}
20 appSwitcherItems={appSwitcherItems}
21 breadcrumbs={
22 <>
23 {owner && (
24 <>
25 <span style={{ color: "var(--text-faint)" }}>/</span>
26 <Link
27 href={`/${owner}`}
28 className="hover:underline truncate"
29 style={{ color: "var(--text-muted)" }}
30 >
31 {owner}
32 </Link>
33 </>
34 )}
35 {owner && repo && (
36 <>
37 <span style={{ color: "var(--text-faint)" }}>/</span>
38 <span className="truncate" style={{ color: "var(--text-primary)" }}>{repo}</span>
39 </>
40 )}
41 </>
42 }
43 />
44 );
45}
46