import React from 'react' import clsx from 'clsx' import {useLocation} from 'react-router' import {checkIsActive, KTIcon, WithChildren} from '../../../../helpers' import {useLayout} from '../../../core' type Props = { to: string title: string icon?: string fontIcon?: string hasBullet?: boolean menuIsOpen?: boolean } const SidebarMenuItemWithSub: React.FC = ({ children, to, title, icon, fontIcon, hasBullet, menuIsOpen=false }) => { const {pathname} = useLocation() const isActive = checkIsActive(pathname, to) || menuIsOpen const {config} = useLayout() const {app} = config return (
{hasBullet && ( )} {icon && app?.sidebar?.default?.menu?.iconType === 'svg' && ( )} {fontIcon && app?.sidebar?.default?.menu?.iconType === 'font' && ( )} {title}
{children}
) } export {SidebarMenuItemWithSub}