import React, { Children, FC } from "react"; import Link from "next/link"; import styles from './breadcrumbs.module.scss'; import clsx from 'clsx'; export type BreadcrumbsProps = { className?: string; style?: object; }; const Breadcrumbs : FC = ({children, className, ...props}) => (
{Children.map(children, (child, index) => { return ( <> { index !== 0 ? ( / ) : undefined } {child} ); })}
); const Crumb : FC = ({children, ...props}) => ( {children} ); export type LinkCrumbProps = { href: string; } const LinkCrumb : FC = ({children, href, ...props}) => ( {children} ); export { Crumb, Breadcrumbs, LinkCrumb };