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