import { ReactNode } from 'react'; import { Icon } from 'react-feather'; import { AutomationTestingProps } from '@/types'; import { Wrapper } from './Wrapper'; import { Menu } from './Menu'; import { Head } from './Head'; import { getPathsForChildren } from './utils'; interface Props extends AutomationTestingProps { icon?: Icon; to: string; params?: object; label: string; children?: ReactNode; openOnPaths?: string[]; } export function SidebarItem({ children, icon, to, params, label, openOnPaths = [], 'data-cy': dataCy, }: Props) { const childrenPath = getPathsForChildren(children); const head = ( ); return ( {children ? ( {children} ) : ( head )} ); }