diff --git a/src/states/Dashboard/components/Sidebar/Sidebar.jsx b/src/states/Dashboard/components/Sidebar/Sidebar.jsx new file mode 100644 index 0000000..2730088 --- /dev/null +++ b/src/states/Dashboard/components/Sidebar/Sidebar.jsx @@ -0,0 +1,73 @@ +import { + Divider, + Drawer, + List, + ListItem, + ListItemButton, + ListItemIcon, + ListItemText, + Stack, + Toolbar, Typography, useTheme +} from "@mui/material"; +import {useLocation, useNavigate} from "react-router-dom"; +import {sidebar} from "@/common/routes"; +import DarkLogo from "@/common/assets/images/logo/small-dark.webp"; +import LightLogo from "@/common/assets/images/logo/small-light.webp"; + +const drawerWidth = 240; + +export const Sidebar = ({mobileOpen, toggleOpen, window: containerWindow}) => { + const location = useLocation(); + const navigate = useNavigate(); + const theme = useTheme(); + const logo = theme.palette.mode === "dark" ? DarkLogo : LightLogo; + + const container = containerWindow !== undefined ? () => containerWindow().document.body : undefined; + + const isSelected = (path) => { + if (path === "/") return location.pathname === "/"; + + return location.pathname.startsWith(path); + } + + const drawer = ( + <> + + + Logo + LicenseAPI + + + + + + + {sidebar.map((route) => ( + + navigate(route.path.replace("/*", ""))}> + {route.icon} + + + + ))} + + + + + + ); + + return ( + <> + + {drawer} + + + {drawer} + + + ) +} \ No newline at end of file