import React from 'react'; import { ContentsNavItemProps, ContentsNavProps } from './types'; import clsx from 'clsx'; const ContentsNavItem = ({ children, isCurrent, href, linkComponent }: ContentsNavItemProps) => { const classNames = ['ds_contents-nav__link']; let ariaCurrent: React.AriaAttributes["aria-current"]; if (isCurrent) { classNames.push('ds_current'); ariaCurrent = 'page'; } const classNamesString = clsx(classNames); function processChildren(children: React.ReactNode) { if (linkComponent) { return linkComponent({ className: classNamesString, href, children }); } else if (href) { return {children}; } else { return {children}; } } return (