import React, { ElementType, forwardRef, HTMLAttributes } from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' import { CLink } from '../link/CLink' import { PolymorphicRefForwardingComponent } from '../../helpers' export interface CBreadcrumbItemProps extends HTMLAttributes { /** * Toggle the active state for the component. */ active?: boolean /** * Component used for the root node. Either a string to use a HTML element or a component. * * @since 5.4.0 */ as?: ElementType /** * A string of all className you want applied to the base component. */ className?: string /** * The `href` attribute for the inner `` component. */ href?: string } export const CBreadcrumbItem: PolymorphicRefForwardingComponent<'li', CBreadcrumbItemProps> = forwardRef( ({ children, active, as, className, href, ...rest }, ref) => { return (
  • {href ? ( {children} ) : ( children )}
  • ) } ) CBreadcrumbItem.propTypes = { active: PropTypes.bool, children: PropTypes.node, className: PropTypes.string, href: PropTypes.string, } CBreadcrumbItem.displayName = 'CBreadcrumbItem'