import * as React from 'react'; import { Nav } from 'react-bootstrap'; import { Fingerprint, History, MiscellaneousServices , ExpandLess, ExpandMore } from '@mui/icons-material/' import { useNavigate, useResolvedPath, useMatch } from 'react-router-dom' import { Collapse,ListItem, List ,ListItemIcon,ListItemText,ListSubheader } from '@mui/material/' import { MainItems, ExtraItems, PruebaItems } from '../../Utils/MenuItems' function NavItem (props) { let navigate = useNavigate() let resolved = useResolvedPath(props.route); let match = useMatch({ path: resolved.pathname, end: true }); let { title, route, icon, open, AppBarVisible, setOpen } = props if(route.startsWith('prueba') && match && open && !AppBarVisible ){ setOpen(false); } return( navigate(route) } button > {icon && icon} ) } export const MainListItems = (props) => { const [open, setOpen] = React.useState(false); const showPruebas = () => { if(!props.AppBarVisible){ props.setAppBarVisible(true); } setOpen(!open); }; return( MENÚ { MainItems.map( ({ icon, title, route}) => ( )) } {open ? : } { PruebaItems.map( ({ route, title}) => ( ) ) } } title="Configuraciones" route="configuraciones" /> } title="Historial" route="historial" /> ) }; export const SecondaryListItems = ( );