` record switcher — same search/popover menu as breadcrumbs, sized for
* `PageHeader` titles on detail routes.
*/
export function PageTitleRecordSwitcher(
props: Omit, "variant" | "isCurrentPage">,
) {
return (
)
}
function BreadcrumbTrailSegment({
crumb,
isCurrentPage = false,
}: {
crumb: Pick
isCurrentPage?: boolean
}) {
if (crumb.menu?.length) {
return (
)
}
if (isCurrentPage) {
return (
{crumb.label}
)
}
if (crumb.href) {
return (
{crumb.label}
)
}
return (
{crumb.label}
)
}
/**
* Single-step back nav — back icon + parent destination (no chevron trail).
* Use in `SiteHeader` for focused child routes (composer, wizard) where the
* page `
` is the current title.
*/
export function PageBreadcrumbBack({ label, href, className }: PageBreadcrumbBackProps) {
return (
{label}
)
}
/**
* Product breadcrumb trail — one component for SiteHeader and in-page shells.
* Uses shadcn `Breadcrumb` primitives with Exxat site-header typography.
*
* For back-icon + parent label only, use {@link PageBreadcrumbBack}.
*/
const EMPTY_BREADCRUMB_ITEMS: PageBreadcrumbTrailItem[] = []
export function PageBreadcrumbTrail({
items = EMPTY_BREADCRUMB_ITEMS,
currentPage,
currentPageMenu,
currentPageMenuAriaLabel,
variant = "content",
className,
}: PageBreadcrumbTrailProps) {
const isHeader = variant === "header"
const trailItems = items ?? EMPTY_BREADCRUMB_ITEMS
const list = (
{trailItems.map((crumb, i) => (
{(currentPage != null || i < trailItems.length - 1) && (
)}
))}
{currentPage != null ? (
) : null}
)
return (
{isHeader ? (
{list}
) : (
list
)}
)
}