"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { ChevronRight, House } from "lucide-react"; const SECTION_LABELS: Record = { control: "Control", sessions: "Sessions", stats: "Stats", devices: "Devices", }; const LEAF_LABELS: Record = { replay: "Replay", }; export function Breadcrumbs() { const pathname = usePathname(); const segments = pathname.split("/").filter(Boolean); if (segments.length === 0) { return null; } const crumbs = segments.reduce<{ label: string; href: string }[]>((acc, segment) => { const href = `${acc.at(-1)?.href ?? ""}/${segment}`; const label = /^\d+$/.test(segment) ? `#${segment}` : (LEAF_LABELS[segment] ?? SECTION_LABELS[segment] ?? segment); return [...acc, { label, href }]; }, []); return ( ); }