diff options
Diffstat (limited to 'modern/src/components/reports/ReportSidebar.js')
-rw-r--r-- | modern/src/components/reports/ReportSidebar.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modern/src/components/reports/ReportSidebar.js b/modern/src/components/reports/ReportSidebar.js new file mode 100644 index 00000000..e42c36ee --- /dev/null +++ b/modern/src/components/reports/ReportSidebar.js @@ -0,0 +1,30 @@ +import React from 'react'; +import { AppBar, Toolbar, Typography, List, ListItem, ListItemText, ListItemIcon, Divider, Drawer, makeStyles, IconButton, Hidden } from '@material-ui/core'; +import { Link, useHistory, useLocation } from 'react-router-dom'; + +const ReportNavbar = ({ routes, setReportName }) => { + + const location = useLocation(); + + return ( + <List disablePadding> + {routes.map((route, index) => ( + <ListItem + disableRipple + component={Link} + key={`${route}${index}`} + button + to={route.href} + selected={route.href === location.pathname} + onClick={() => setReportName(route.name)}> + <ListItemIcon> + {route.icon} + </ListItemIcon> + <ListItemText primary={route.name} /> + </ListItem> + ))} + </List> + ) +} + +export default ReportNavbar; |