(props: BreadcrumbsProps)
| 19 | } |
| 20 | |
| 21 | export function Breadcrumbs(props: BreadcrumbsProps) { |
| 22 | let {navProps} = useBreadcrumbs(props); |
| 23 | let childCount = Children.count(props.children); |
| 24 | |
| 25 | return ( |
| 26 | <nav {...navProps}> |
| 27 | <ol className="react-aria-Breadcrumbs"> |
| 28 | {/* Mark the last item as the current page. */} |
| 29 | {Children.map(props.children, (child, i) => |
| 30 | isValidElement<BreadcrumbProps>(child) |
| 31 | ? cloneElement(child, {isCurrent: i === childCount - 1}) |
| 32 | : child |
| 33 | )} |
| 34 | </ol> |
| 35 | </nav> |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | export type BreadcrumbProps = AriaBreadcrumbItemProps; |
| 40 |
nothing calls this directly
no test coverage detected