type Crumb = { label: string action?: () => void } type BreadcrumbsProps = { items: Crumb[] } export function Breadcrumbs({ items }: BreadcrumbsProps) { if (!items.length) return null return (
{items.map((item, index) => { const isLast = index === items.length - 1 return ( {!isLast && item.action ? ( {item.label} ) : ( {item.label} )} {!isLast ? ' / ' : ''} ) })}
) }