import type { FC, JSX } from 'react' import { ChevronRightIcon, HomeIcon } from '@heroicons/react/24/solid' import { Link, Typography } from '..' export interface BreadcrumbLink { href: string label: string } interface BreadcrumbProps { home: string links: BreadcrumbLink[] } export const Breadcrumb: FC = ({ links, home }) => { return (
{links .map((link, index) => { const last = links.length === index + 1 if (last) { return ( {link.label} ) } return (
{link.label}
) }) .reduce( (prev, cur, index) => [...prev, , cur], [], )}
) }