"use client" import Link from "next/link" import { usePathname } from "next/navigation" import { ChevronRight, Home } from "lucide-react" const SEGMENT_LABELS: Record = { dashboard: "Dashboard", properties: "Properties", tenants: "Tenants", rent: "Rent Tracker", maintenance: "Maintenance", leases: "Leases", expenses: "Expenses", reports: "Reports", vendors: "Vendors", inspections: "Inspections", ai: "AI Assistant", settings: "Settings", profile: "Profile", billing: "Billing", demo: "Demo Data", new: "New", edit: "Edit", generate: "Generate", documents: "Documents", } function isUUID(s: string) { return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) } export function Breadcrumbs() { const pathname = usePathname() const segments = pathname.split("/").filter(Boolean) // Don't show on top-level pages (only 1 segment) if (segments.length <= 1) return null const crumbs: { label: string; href: string }[] = [] let acc = "" for (const seg of segments) { acc += `/${seg}` if (isUUID(seg)) { crumbs.push({ label: "Detail", href: acc }) } else { crumbs.push({ label: SEGMENT_LABELS[seg] ?? seg, href: acc }) } } return ( ) }