2022-12-02 10:55:56 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
|
import {
|
|
|
|
|
Box,
|
|
|
|
|
Grid,
|
|
|
|
|
Typography,
|
|
|
|
|
List,
|
|
|
|
|
ListItem,
|
|
|
|
|
ListItemIcon,
|
|
|
|
|
ListItemText,
|
|
|
|
|
Drawer,
|
2022-12-02 17:45:14 +01:00
|
|
|
Accordion,
|
|
|
|
|
AccordionSummary,
|
|
|
|
|
AccordionDetails,
|
2022-12-02 10:55:56 +00:00
|
|
|
} from "@mui/material";
|
2022-12-02 17:45:14 +01:00
|
|
|
import {
|
|
|
|
|
FeaturedPlayList as FeaturedPlayListIcon,
|
|
|
|
|
Person as PersonIcon,
|
|
|
|
|
Analytics as AnalyticsIcon,
|
|
|
|
|
Logout as LogoutIcon,
|
|
|
|
|
Cottage as CottageIcon,
|
|
|
|
|
Settings as SettingsIcon,
|
|
|
|
|
} from "@mui/icons-material";
|
2022-12-02 10:55:56 +00:00
|
|
|
import Link from "next/link";
|
|
|
|
|
|
2022-12-02 17:45:14 +01:00
|
|
|
const MenuItem = ({ name, href, Icon, iconSize, indent = 0 }: any) => (
|
2022-12-02 10:55:56 +00:00
|
|
|
<Link href={href} passHref>
|
2022-12-02 17:45:14 +01:00
|
|
|
<ListItem button sx={{ p: 0, pb: 2, pr: indent * 5 }}>
|
2022-12-02 10:55:56 +00:00
|
|
|
<ListItemIcon
|
|
|
|
|
sx={{
|
2022-12-02 17:45:14 +01:00
|
|
|
color: `white`,
|
2022-12-02 10:55:56 +00:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: iconSize,
|
|
|
|
|
height: iconSize,
|
2022-12-02 17:45:14 +01:00
|
|
|
mr: 0.5,
|
2022-12-02 10:55:56 +00:00
|
|
|
}}
|
|
|
|
|
>
|
2022-12-02 17:45:14 +01:00
|
|
|
{iconSize > 0 && <Icon />}
|
2022-12-02 10:55:56 +00:00
|
|
|
</Box>
|
|
|
|
|
|
|
|
|
|
<ListItemText
|
|
|
|
|
primary={
|
|
|
|
|
<Typography
|
|
|
|
|
variant="body1"
|
2022-12-02 17:45:14 +01:00
|
|
|
sx={{
|
|
|
|
|
color: "#fff !important",
|
2022-12-02 10:55:56 +00:00
|
|
|
fontSize: 14,
|
|
|
|
|
fontFamily: "Roboto",
|
|
|
|
|
fontWeight: 400,
|
2022-12-02 17:45:14 +01:00
|
|
|
marginLeft: "12px",
|
|
|
|
|
marginTop: "-1px",
|
|
|
|
|
textDecoration: "none !important",
|
|
|
|
|
">a": {
|
|
|
|
|
textDecoration: "none !important",
|
|
|
|
|
},
|
|
|
|
|
"a:visited": {
|
|
|
|
|
textDecoration: "none !important",
|
|
|
|
|
},
|
|
|
|
|
border: 0,
|
2022-12-02 10:55:56 +00:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{name}
|
|
|
|
|
</Typography>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</ListItemIcon>
|
|
|
|
|
</ListItem>
|
|
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
interface SidebarProps {
|
|
|
|
|
open: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const Sidebar: FC<SidebarProps> = ({ open }) => (
|
|
|
|
|
<Drawer
|
2022-12-02 17:45:14 +01:00
|
|
|
sx={{ width: 300, flexShrink: 0 }}
|
2022-12-02 10:55:56 +00:00
|
|
|
variant="permanent"
|
|
|
|
|
anchor="left"
|
|
|
|
|
open={open}
|
|
|
|
|
PaperProps={{
|
|
|
|
|
sx: {
|
|
|
|
|
width: 300,
|
|
|
|
|
border: 0,
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Grid
|
|
|
|
|
container
|
|
|
|
|
direction="column"
|
|
|
|
|
justifyContent="space-between"
|
|
|
|
|
wrap="nowrap"
|
2022-12-02 17:45:14 +01:00
|
|
|
sx={{ backgroundColor: "#25272A", height: "100%", p: 2 }}
|
2022-12-02 10:55:56 +00:00
|
|
|
>
|
2022-12-02 17:45:14 +01:00
|
|
|
<Grid item>
|
|
|
|
|
<Typography variant="h6" sx={{ fontSize: 12, color: "white" }}>
|
|
|
|
|
Hello
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Typography variant="h2" sx={{ fontSize: 22, color: "white", mb: 1.5 }}>
|
|
|
|
|
Agent/User
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Box sx={{ height: 1.5, width: "100%", backgroundColor: "white" }} />
|
|
|
|
|
</Grid>
|
2022-12-02 10:55:56 +00:00
|
|
|
<Grid item container direction="column" sx={{ mt: "6px" }} flexGrow={1}>
|
|
|
|
|
<List component="nav">
|
2022-12-02 17:45:14 +01:00
|
|
|
<MenuItem name="Home" href="/" Icon={CottageIcon} iconSize={20} />
|
|
|
|
|
<Accordion
|
|
|
|
|
sx={{
|
|
|
|
|
backgroundColor: "#25272A",
|
|
|
|
|
border: 0,
|
|
|
|
|
m: 0,
|
|
|
|
|
p: 0,
|
|
|
|
|
boxShadow: "none",
|
|
|
|
|
mt: -1,
|
|
|
|
|
mb: -1,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<AccordionSummary sx={{ p: 0, m: 0 }}>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="My tickets"
|
|
|
|
|
href="/assigned"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
/>
|
|
|
|
|
</AccordionSummary>
|
|
|
|
|
<AccordionDetails sx={{ p: 0, mt: -2, ml: "20px" }}>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Assigned"
|
|
|
|
|
href="/assigned"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Urgent"
|
|
|
|
|
href="/urgent"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Pending"
|
|
|
|
|
href="/pending"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Unassigned"
|
|
|
|
|
href="/unassigned"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
/>
|
|
|
|
|
</AccordionDetails>
|
|
|
|
|
</Accordion>
|
|
|
|
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Leafcutter"
|
|
|
|
|
href="/leafcutter"
|
|
|
|
|
Icon={AnalyticsIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Profile"
|
|
|
|
|
href="/profile"
|
|
|
|
|
Icon={PersonIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Settings"
|
|
|
|
|
href="/settings"
|
|
|
|
|
Icon={SettingsIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Logout"
|
|
|
|
|
href="/logout"
|
|
|
|
|
Icon={LogoutIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
/>
|
2022-12-02 10:55:56 +00:00
|
|
|
</List>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Drawer>
|
|
|
|
|
);
|