import ConditionalWrapper from "../../common/ConditionalWrapper"; import WrapperTag from "../../common/WrapperTag"; import { CategoryItemProps } from "./types"; import clsx from 'clsx'; const CategoryItem = ({ children, className, headingLevel = 'h2', href, linkComponent, tagName = 'div', title, ...props }: CategoryItemProps) => { const LINK_CLASS = 'ds_category-item__link'; function getLinkElement(children: React.ReactNode) { let linkElement; if (linkComponent) { linkElement = linkComponent({ className: LINK_CLASS, href, children }); } else { linkElement = {children}; } return linkElement as React.JSX.Element; } return ( getLinkElement(children)} > {title} {children &&

{children}

}
); }; CategoryItem.displayName = 'CategoryItem'; export default CategoryItem;