import { ChevronDown, Check } from "lucide-react"; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { useNavigation, type PageId } from "@/contexts/navigation-context"; import { featureBreadcrumbs, routeHref } from "@/lib/feature-navigation"; export function DashboardBreadcrumbs() { const { currentPage, navigateTo } = useNavigation(); const location = featureBreadcrumbs(currentPage); const follow = (event: React.MouseEvent, page: PageId) => { if (!event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey) { event.preventDefault(); navigateTo(page); } }; return ( follow(event, "dashboard")} > Swift Commerce {location.group && ( <> {location.siblings.length > 1 ? ( {location.group} {location.siblings.map((feature) => ( follow(event, feature.pageId)} aria-current={ feature.pageId === currentPage ? "page" : undefined } className="flex items-center justify-between gap-3" > {feature.title} {feature.pageId === currentPage && ( ))} ) : ( follow(event, "dashboard")} > {location.group} )} )} {location.title} ); }