import { ReactElement, forwardRef } from 'react'; import { NavLink as RouterLink } from 'react-router-dom'; // @mui import { Box, Link } from '@mui/material'; // config import { ICON } from '../../../config'; // type import { NavItemProps } from '../type'; // import Iconify from '../../Iconify'; import { ListItemStyle } from './style'; import { isExternalLink } from '..'; // ---------------------------------------------------------------------- export const NavItemRoot = forwardRef( ({ item, active, open, onMouseEnter, onMouseLeave }, ref) => { const { title, path, icon, children } = item; if (children) { return ( ); } return isExternalLink(path) ? ( ) : ( ); } ); // ---------------------------------------------------------------------- export const NavItemSub = forwardRef( ({ item, active, open, onMouseEnter, onMouseLeave }, ref) => { const { title, path, icon, children } = item; if (children) { return ( ); } return isExternalLink(path) ? ( ) : ( ); } ); // ---------------------------------------------------------------------- type NavItemContentProps = { title: string; icon?: ReactElement; children?: { title: string; path: string }[]; subItem?: boolean; }; function NavItemContent({ icon, title, children, subItem }: NavItemContentProps) { return ( <> {icon && ( {icon} )} {title} {children && ( )} ); }