Side Av
Side Av
fetchMenus();
}, []);
//end
const router = useRouter();
const content = (
<Scrollbar
sx={{
height: "100%",
"& .simplebar-content": {
height: "100%",
},
"& .simplebar-content-wrapper": {
overflow: "auto !important",
},
"& .simplebar-scrollbar:before": {
background: "neutral.400",
},
}}
>
<Box
sx={{
display: "flex",
flexDirection: "column",
height: "100%",
}}
>
<Box sx={{ p: 2, pl: 6 }}>
<Box
component={NextLink}
href="/"
sx={{
display: "inline-flex",
}}
>
<NextImage
src="/assets/logos/sanad-logo.png"
height={70}
width={180}
style={{
objectFit: "contain",
}}
priority={true}
id="app-logo"
alt="Logo"
/>
</Box>
</Box>
<Divider sx={{ borderColor: "neutral.700" }} />
<Box
component="nav"
sx={{
flexGrow: 1,
px: 2,
py: 3,
}}
>
{sections.map((section, idx) => (
<DashboardSidebarSection key={idx} path={router.asPath}
title={section.title || ""} {...section} />
))}
</Box>
<Divider sx={{ borderColor: "neutral.700" }} />
</Box>
</Scrollbar>
);
if (lgUp) {
return (
<Drawer
anchor="left"
open
PaperProps={{
sx: {
backgroundColor: "neutral.800",
color: "common.white",
width: 280,
},
}}
variant="permanent"
>
{content}
</Drawer>
);
}
return (
<Drawer
anchor="left"
onClose={onClose}
open={open}
PaperProps={{
sx: {
backgroundColor: "neutral.800",
color: "common.white",
width: 280,
},
}}
sx={{ zIndex: (theme) => theme.zIndex.appBar + 100 }}
variant="temporary"
>
{content}
</Drawer>
);
};
SideNav.propTypes = {
onClose: PropTypes.func,
open: PropTypes.bool,
};