import React from 'react'; import { List, ListItem, ListItemText, ListItemIcon, Divider, ListSubheader, } from '@material-ui/core'; import { Link, useLocation } from 'react-router-dom'; const SideNav = ({ routes }) => { const location = useLocation(); return ( {routes.map((route, index) => (route.subheader ? ( <> {route.subheader} ) : ( {route.icon} )))} ); }; export default SideNav;