import { getClassNames } from '@websolutespa/bom-core'; import React, { ReactNode } from 'react'; import { UrlObject } from 'url'; import { Button } from '../button/button'; import { Link, LinkProps } from '../link/link'; type Url = string | UrlObject; type Props = { href?: Url; onClick?: (event: React.MouseEvent) => void className?: string, children?: ReactNode, }; type NativeAttrs = Omit, keyof Props>; type NativeLinkAttrs = Omit; export type BreadcrumbItemProps = Props & NativeLinkAttrs; export const BreadcrumbItem = React.forwardRef>(({ children, className = '', href, onClick, ...props }: BreadcrumbItemProps, ref: React.Ref) => { const onClick_ = (event: React.MouseEvent) => { onClick && onClick(event); }; const classNames = getClassNames('breadcrumb-item', className); if (href) { return ( ); } return ( {children} ); }); BreadcrumbItem.displayName = 'BreadcrumbItem';