"use client" import * as React from "react" import { Link, useNavigate } from "react-router" import { cn } from "@/lib/utils" import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "@/components/ui/breadcrumb" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { Input } from "@/components/ui/input" import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover" import { Tip } from "@/components/ui/tip" import { useScrollStuck } from "@/hooks/use-scroll-stuck" import { FILTER_LIST_SEARCH_THRESHOLD } from "@exxatdesignux/ui/lib/filter-list-search-threshold" import { useRowFitLadder } from "@exxatdesignux/ui/hooks/use-row-fit-ladder" // The page `

` type, shared with `PageHeader` so a record switcher title and a // plain title are the same size on sibling routes. import { PAGE_TITLE_TYPE_CLASS } from "@/components/page-header" export interface PageBreadcrumbMenuOption { id: string label: string href?: string onSelect?: () => void selected?: boolean } export interface PageBreadcrumbTrailItem { label: string href?: string /** Peer options — renders a switcher instead of a static link or label. */ menu?: PageBreadcrumbMenuOption[] menuAriaLabel?: string } export interface PageBreadcrumbBackProps { /** Destination label (e.g. "Question hub") — spoken on the icon, not shown at rest. */ label: string href: string /** Current page title — shown after the back icon once the page scrolls. */ scrollTitle?: string /** Peer record switcher for the title (same menu as breadcrumb leaf / PageHeader). */ scrollTitleMenu?: PageBreadcrumbMenuOption[] scrollTitleMenuAriaLabel?: string className?: string } export interface PageBreadcrumbTrailProps { /** Linkable ancestors (e.g. Question hub). */ items?: PageBreadcrumbTrailItem[] /** * Final segment in the trail. Omit when the current page is the `PageHeader` * `

` — use ancestors-only above the title (no duplicate label). */ currentPage?: string /** Switch among peer records on the current page segment (detail routes). */ currentPageMenu?: PageBreadcrumbMenuOption[] currentPageMenuAriaLabel?: string /** * Where the trail sits: `header` (SiteHeader / utility bar, ancestors + * `currentPage`) or `content` (ancestors only, above a `PageHeader` title). * * Reaches the DOM as `data-trail-variant` and nothing else. How much of the * trail shows is measured from the room the trail is given, so both places * collapse on the same evidence rather than on a count picked per variant. */ variant?: "header" | "content" className?: string } function BreadcrumbMenuOptionMarker({ selected }: { selected?: boolean }) { return selected ? (