Files
furumi-ng/furumi-node-player/client/src/components/Breadcrumbs.tsx
Boris Cherepanov d654fe9442
Some checks failed
Publish Metadata Agent Image / build-and-push-image (push) Successful in 1m12s
Publish Web Player Image / build-and-push-image (push) Has been cancelled
Publish Server Image / build-and-push-image (push) Has been cancelled
feat: refactoring modules
2026-03-19 17:31:09 +03:00

31 lines
655 B
TypeScript

type Crumb = {
label: string
action?: () => void
}
type BreadcrumbsProps = {
items: Crumb[]
}
export function Breadcrumbs({ items }: BreadcrumbsProps) {
if (!items.length) return null
return (
<div className="breadcrumb">
{items.map((item, index) => {
const isLast = index === items.length - 1
return (
<span key={`${item.label}-${index}`}>
{!isLast && item.action ? (
<span onClick={item.action}>{item.label}</span>
) : (
<span>{item.label}</span>
)}
{!isLast ? ' / ' : ''}
</span>
)
})}
</div>
)
}