2023-06-26 10:07:12 +00:00
|
|
|
"use client";
|
|
|
|
|
|
2022-12-14 13:24:50 +01:00
|
|
|
import { FC, useState } from "react";
|
2023-06-07 08:02:29 +00:00
|
|
|
import useSWR from "swr";
|
2022-12-02 10:55:56 +00:00
|
|
|
import {
|
|
|
|
|
Box,
|
|
|
|
|
Grid,
|
|
|
|
|
Typography,
|
|
|
|
|
List,
|
2022-12-14 13:24:50 +01:00
|
|
|
ListItemButton,
|
2022-12-02 10:55:56 +00:00
|
|
|
ListItemIcon,
|
|
|
|
|
ListItemText,
|
2022-12-14 13:24:50 +01:00
|
|
|
ListItemSecondaryAction,
|
2022-12-02 10:55:56 +00:00
|
|
|
Drawer,
|
2022-12-14 13:24:50 +01:00
|
|
|
Collapse,
|
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,
|
2023-01-11 16:18:56 +01:00
|
|
|
ExpandCircleDown as ExpandCircleDownIcon,
|
2023-06-07 08:02:29 +00:00
|
|
|
Dvr as DvrIcon,
|
2022-12-02 17:45:14 +01:00
|
|
|
} from "@mui/icons-material";
|
2023-06-26 10:07:12 +00:00
|
|
|
import { usePathname } from "next/navigation";
|
2022-12-02 10:55:56 +00:00
|
|
|
import Link from "next/link";
|
2022-12-14 13:24:50 +01:00
|
|
|
import Image from "next/image";
|
|
|
|
|
import LinkLogo from "public/link-logo-small.png";
|
2023-06-07 08:02:29 +00:00
|
|
|
import { useSession, signOut } from "next-auth/react";
|
2023-07-11 13:48:05 +00:00
|
|
|
import { getTicketOverviewCountsQuery } from "app/_graphql/getTicketOverviewCountsQuery";
|
2022-12-02 10:55:56 +00:00
|
|
|
|
2022-12-14 13:24:50 +01:00
|
|
|
const openWidth = 270;
|
|
|
|
|
const closedWidth = 100;
|
|
|
|
|
|
|
|
|
|
const MenuItem = ({
|
|
|
|
|
name,
|
|
|
|
|
href,
|
|
|
|
|
Icon,
|
|
|
|
|
iconSize,
|
|
|
|
|
inset = false,
|
|
|
|
|
selected = false,
|
2023-01-11 16:18:56 +01:00
|
|
|
open = true,
|
2022-12-14 13:24:50 +01:00
|
|
|
badge,
|
2023-06-07 08:02:29 +00:00
|
|
|
target = "_self",
|
2022-12-14 13:24:50 +01:00
|
|
|
}: any) => (
|
2023-06-07 08:02:29 +00:00
|
|
|
<Link href={href} target={target}>
|
2022-12-14 13:24:50 +01:00
|
|
|
<ListItemButton
|
2023-01-11 16:18:56 +01:00
|
|
|
sx={{
|
|
|
|
|
p: 0,
|
|
|
|
|
mb: 1,
|
|
|
|
|
bl: iconSize === 0 ? "1px solid white" : "inherit",
|
|
|
|
|
}}
|
2022-12-14 13:24:50 +01:00
|
|
|
selected={selected}
|
|
|
|
|
>
|
|
|
|
|
{iconSize > 0 ? (
|
|
|
|
|
<ListItemIcon
|
|
|
|
|
sx={{
|
|
|
|
|
color: `white`,
|
|
|
|
|
minWidth: 0,
|
|
|
|
|
mr: 2,
|
2023-01-11 16:18:56 +01:00
|
|
|
textAlign: "center",
|
|
|
|
|
margin: open ? "0 8 0 0" : "0 auto",
|
2022-12-14 13:24:50 +01:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: iconSize,
|
|
|
|
|
height: iconSize,
|
|
|
|
|
mr: 0.5,
|
|
|
|
|
mt: "-4px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Icon />
|
|
|
|
|
</Box>
|
|
|
|
|
</ListItemIcon>
|
|
|
|
|
) : (
|
2022-12-02 10:55:56 +00:00
|
|
|
<Box
|
|
|
|
|
sx={{
|
2022-12-14 13:24:50 +01:00
|
|
|
width: 30,
|
|
|
|
|
height: "28px",
|
|
|
|
|
position: "relative",
|
|
|
|
|
ml: "9px",
|
|
|
|
|
mr: "1px",
|
2022-12-02 10:55:56 +00:00
|
|
|
}}
|
|
|
|
|
>
|
2022-12-14 13:24:50 +01:00
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: "1px",
|
|
|
|
|
height: "56px",
|
|
|
|
|
backgroundColor: "white",
|
|
|
|
|
position: "absolute",
|
|
|
|
|
left: "3px",
|
|
|
|
|
top: "-10px",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: "42px",
|
|
|
|
|
height: "42px",
|
|
|
|
|
position: "absolute",
|
|
|
|
|
top: "-27px",
|
|
|
|
|
left: "3px",
|
|
|
|
|
border: "solid 1px #fff",
|
|
|
|
|
borderColor: "transparent transparent transparent #fff",
|
|
|
|
|
borderRadius: "60px",
|
|
|
|
|
rotate: "-35deg",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
2022-12-02 10:55:56 +00:00
|
|
|
</Box>
|
2022-12-14 13:24:50 +01:00
|
|
|
)}
|
2023-01-11 16:18:56 +01:00
|
|
|
{open && (
|
|
|
|
|
<ListItemText
|
|
|
|
|
inset={inset}
|
|
|
|
|
primary={
|
|
|
|
|
<Typography
|
|
|
|
|
variant="body1"
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontFamily: "Roboto",
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
border: 0,
|
|
|
|
|
textAlign: "left",
|
2023-05-25 12:37:14 +00:00
|
|
|
color: "white",
|
2023-01-11 16:18:56 +01:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{name}
|
|
|
|
|
</Typography>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2023-06-07 08:02:29 +00:00
|
|
|
{badge && badge > 0 ? (
|
2022-12-14 13:24:50 +01:00
|
|
|
<ListItemSecondaryAction>
|
|
|
|
|
<Typography
|
|
|
|
|
color="textSecondary"
|
|
|
|
|
variant="body1"
|
|
|
|
|
className="badge"
|
|
|
|
|
sx={{
|
|
|
|
|
backgroundColor: "#FFB620",
|
|
|
|
|
color: "black !important",
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
px: 1,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{badge}
|
|
|
|
|
</Typography>
|
|
|
|
|
</ListItemSecondaryAction>
|
2023-06-07 08:02:29 +00:00
|
|
|
) : null}
|
2022-12-14 13:24:50 +01:00
|
|
|
</ListItemButton>
|
2022-12-02 10:55:56 +00:00
|
|
|
</Link>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
interface SidebarProps {
|
|
|
|
|
open: boolean;
|
2023-01-11 16:18:56 +01:00
|
|
|
setOpen: (open: boolean) => void;
|
2022-12-02 10:55:56 +00:00
|
|
|
}
|
|
|
|
|
|
2023-01-11 16:18:56 +01:00
|
|
|
export const Sidebar: FC<SidebarProps> = ({ open, setOpen }) => {
|
2023-06-26 10:07:12 +00:00
|
|
|
const pathname = usePathname();
|
2023-05-25 12:37:14 +00:00
|
|
|
const { data: session } = useSession();
|
|
|
|
|
const username = session?.user?.name || "User";
|
2023-06-07 08:02:29 +00:00
|
|
|
const { data: overviewData, error: overviewError }: any = useSWR(
|
|
|
|
|
{
|
|
|
|
|
document: getTicketOverviewCountsQuery,
|
|
|
|
|
},
|
2023-07-21 12:26:02 +00:00
|
|
|
{ refreshInterval: 10000 },
|
2023-06-07 08:02:29 +00:00
|
|
|
);
|
|
|
|
|
const findOverviewCountByID = (id: number) =>
|
|
|
|
|
overviewData?.ticketOverviews?.edges?.find((overview: any) =>
|
2023-07-21 12:26:02 +00:00
|
|
|
overview.node.id.endsWith(`/${id}`),
|
2023-06-07 08:02:29 +00:00
|
|
|
)?.node?.ticketCount ?? 0;
|
|
|
|
|
const assignedCount = findOverviewCountByID(1);
|
|
|
|
|
const urgentCount = findOverviewCountByID(7);
|
|
|
|
|
const pendingCount = findOverviewCountByID(3);
|
|
|
|
|
const unassignedCount = findOverviewCountByID(2);
|
|
|
|
|
|
|
|
|
|
const logout = () => {
|
|
|
|
|
signOut({ callbackUrl: "/login" });
|
|
|
|
|
};
|
2023-01-11 16:18:56 +01:00
|
|
|
|
2022-12-14 13:24:50 +01:00
|
|
|
return (
|
|
|
|
|
<Drawer
|
|
|
|
|
sx={{ width: open ? openWidth : closedWidth, flexShrink: 0 }}
|
|
|
|
|
variant="permanent"
|
|
|
|
|
anchor="left"
|
|
|
|
|
open={open}
|
|
|
|
|
PaperProps={{
|
|
|
|
|
sx: {
|
|
|
|
|
width: open ? openWidth : closedWidth,
|
|
|
|
|
border: 0,
|
2023-01-11 16:18:56 +01:00
|
|
|
overflow: "visible",
|
2022-12-14 13:24:50 +01:00
|
|
|
},
|
|
|
|
|
}}
|
2022-12-02 10:55:56 +00:00
|
|
|
>
|
2023-01-11 16:18:56 +01:00
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
position: "absolute",
|
|
|
|
|
top: 20,
|
|
|
|
|
right: open ? -8 : -16,
|
|
|
|
|
color: "#1C75FD",
|
|
|
|
|
rotate: open ? "90deg" : "-90deg",
|
|
|
|
|
}}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
setOpen!(!open);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<ExpandCircleDownIcon
|
|
|
|
|
sx={{
|
|
|
|
|
width: 30,
|
|
|
|
|
height: 30,
|
|
|
|
|
background: "white",
|
|
|
|
|
borderRadius: 500,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Box>
|
2022-12-14 13:24:50 +01:00
|
|
|
<Grid
|
|
|
|
|
container
|
|
|
|
|
direction="column"
|
|
|
|
|
justifyContent="space-between"
|
|
|
|
|
wrap="nowrap"
|
|
|
|
|
sx={{ backgroundColor: "#25272A", height: "100%", p: 2 }}
|
|
|
|
|
>
|
|
|
|
|
<Grid item container>
|
2023-01-11 16:18:56 +01:00
|
|
|
<Grid item sx={{ width: open ? "40px" : "100%" }}>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: "40px",
|
|
|
|
|
height: "40px",
|
|
|
|
|
margin: open ? "0" : "0 auto",
|
|
|
|
|
}}
|
|
|
|
|
>
|
2022-12-14 13:24:50 +01:00
|
|
|
<Image
|
|
|
|
|
src={LinkLogo}
|
|
|
|
|
alt="Link logo"
|
|
|
|
|
width={40}
|
|
|
|
|
height={40}
|
|
|
|
|
style={{
|
|
|
|
|
objectFit: "cover",
|
|
|
|
|
filter: "grayscale(100) brightness(100)",
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Box>
|
|
|
|
|
.
|
|
|
|
|
</Grid>
|
2023-01-11 16:18:56 +01:00
|
|
|
{open && (
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Typography
|
|
|
|
|
variant="h2"
|
|
|
|
|
sx={{
|
|
|
|
|
fontSize: 26,
|
|
|
|
|
color: "white",
|
|
|
|
|
fontWeight: 700,
|
|
|
|
|
mt: 1,
|
|
|
|
|
ml: 0.5,
|
|
|
|
|
fontFamily: "Poppins",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
CDR Link
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
)}
|
2022-12-14 13:24:50 +01:00
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Box
|
2022-12-02 17:45:14 +01:00
|
|
|
sx={{
|
2022-12-14 13:24:50 +01:00
|
|
|
height: "0.5px",
|
|
|
|
|
width: "100%",
|
|
|
|
|
backgroundColor: "#666",
|
|
|
|
|
mb: 1,
|
2022-12-02 17:45:14 +01:00
|
|
|
}}
|
|
|
|
|
/>
|
2022-12-14 13:24:50 +01:00
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Typography
|
|
|
|
|
variant="h6"
|
2023-01-11 16:18:56 +01:00
|
|
|
sx={{
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: "#999",
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
textAlign: open ? "left" : "center",
|
|
|
|
|
}}
|
2022-12-14 13:24:50 +01:00
|
|
|
>
|
|
|
|
|
Hello
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Typography
|
|
|
|
|
variant="h2"
|
2023-01-11 16:18:56 +01:00
|
|
|
sx={{
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
color: "white",
|
|
|
|
|
mb: 1.5,
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
textAlign: open ? "left" : "center",
|
|
|
|
|
}}
|
2022-12-14 13:24:50 +01:00
|
|
|
>
|
2023-01-11 16:18:56 +01:00
|
|
|
{open
|
|
|
|
|
? username
|
|
|
|
|
: username
|
2023-05-25 12:37:14 +00:00
|
|
|
.split(" ")
|
|
|
|
|
.map((name) => name.substring(0, 1))
|
|
|
|
|
.join("")}
|
2022-12-14 13:24:50 +01:00
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{ height: "0.5px", width: "100%", backgroundColor: "#666" }}
|
2022-12-02 17:45:14 +01:00
|
|
|
/>
|
2022-12-14 13:24:50 +01:00
|
|
|
</Grid>
|
|
|
|
|
<Grid item container direction="column" sx={{ mt: "6px" }} flexGrow={1}>
|
|
|
|
|
<List
|
|
|
|
|
component="nav"
|
|
|
|
|
sx={{
|
|
|
|
|
a: {
|
|
|
|
|
textDecoration: "none",
|
|
|
|
|
|
|
|
|
|
".MuiListItemButton-root": {
|
|
|
|
|
p: 1,
|
|
|
|
|
borderRadius: 2,
|
|
|
|
|
"&:hover": {
|
|
|
|
|
background: "#555",
|
|
|
|
|
},
|
|
|
|
|
".MuiTypography-root": {
|
|
|
|
|
p: {
|
|
|
|
|
color: "#999 !important",
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
".badge": {
|
|
|
|
|
p: { fontSize: 12, color: "black !important" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
".Mui-selected": {
|
|
|
|
|
background: "#444",
|
|
|
|
|
color: "#fff !important",
|
|
|
|
|
".MuiTypography-root": {
|
|
|
|
|
p: {
|
|
|
|
|
color: "#fff !important",
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
".badge": {
|
|
|
|
|
p: { fontSize: 12, color: "black !important" },
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Home"
|
|
|
|
|
href="/"
|
|
|
|
|
Icon={CottageIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
selected={pathname.endsWith("/")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Tickets"
|
2023-06-26 10:07:12 +00:00
|
|
|
href="/overview/assigned"
|
2022-12-14 13:24:50 +01:00
|
|
|
Icon={FeaturedPlayListIcon}
|
2023-06-26 10:07:12 +00:00
|
|
|
selected={
|
|
|
|
|
pathname.startsWith("/overview") ||
|
|
|
|
|
pathname.startsWith("/tickets")
|
|
|
|
|
}
|
2022-12-14 13:24:50 +01:00
|
|
|
iconSize={20}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<Collapse
|
2023-06-26 10:07:12 +00:00
|
|
|
in={
|
|
|
|
|
pathname.startsWith("/overview") ||
|
|
|
|
|
pathname.startsWith("/tickets")
|
|
|
|
|
}
|
2022-12-14 13:24:50 +01:00
|
|
|
timeout="auto"
|
|
|
|
|
unmountOnExit
|
|
|
|
|
onClick={undefined}
|
|
|
|
|
>
|
|
|
|
|
<List component="div" disablePadding>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Assigned"
|
2023-06-26 10:07:12 +00:00
|
|
|
href="/overview/assigned"
|
2022-12-14 13:24:50 +01:00
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
2023-06-26 10:07:12 +00:00
|
|
|
selected={pathname.endsWith("/overview/assigned")}
|
2023-06-07 08:02:29 +00:00
|
|
|
badge={assignedCount}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Urgent"
|
2023-06-26 10:07:12 +00:00
|
|
|
href="/overview/urgent"
|
2022-12-14 13:24:50 +01:00
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
2023-06-26 10:07:12 +00:00
|
|
|
selected={pathname.endsWith("/overview/urgent")}
|
2023-06-07 08:02:29 +00:00
|
|
|
badge={urgentCount}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Pending"
|
2023-06-26 10:07:12 +00:00
|
|
|
href="/overview/pending"
|
2022-12-14 13:24:50 +01:00
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
2023-06-26 10:07:12 +00:00
|
|
|
selected={pathname.endsWith("/overview/pending")}
|
2023-06-07 08:02:29 +00:00
|
|
|
badge={pendingCount}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Unassigned"
|
2023-06-26 10:07:12 +00:00
|
|
|
href="/overview/unassigned"
|
2022-12-14 13:24:50 +01:00
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
2023-06-26 10:07:12 +00:00
|
|
|
selected={pathname.endsWith("/overview/unassigned")}
|
2023-06-07 08:02:29 +00:00
|
|
|
badge={unassignedCount}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
</List>
|
|
|
|
|
</Collapse>
|
2023-05-25 12:37:14 +00:00
|
|
|
<MenuItem
|
|
|
|
|
name="Knowledge Base"
|
|
|
|
|
href="/knowledge"
|
|
|
|
|
Icon={CottageIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
selected={pathname.endsWith("/knowledge")}
|
|
|
|
|
open={open}
|
|
|
|
|
/>
|
2022-12-14 13:24:50 +01:00
|
|
|
<MenuItem
|
|
|
|
|
name="Leafcutter"
|
2023-07-21 12:26:02 +00:00
|
|
|
href="/leafcutter"
|
2022-12-14 13:24:50 +01:00
|
|
|
Icon={AnalyticsIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
selected={pathname.endsWith("/leafcutter")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<Collapse
|
|
|
|
|
in={pathname.startsWith("/leafcutter")}
|
|
|
|
|
timeout="auto"
|
|
|
|
|
unmountOnExit
|
|
|
|
|
onClick={undefined}
|
|
|
|
|
>
|
|
|
|
|
<List component="div" disablePadding>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Dashboard"
|
|
|
|
|
href="/leafcutter"
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/leafcutter")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Search and Create"
|
|
|
|
|
href="/leafcutter/create"
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/leafcutter/create")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Trends"
|
|
|
|
|
href="/leafcutter/trends"
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/leafcutter/trends")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="FAQ"
|
|
|
|
|
href="/leafcutter/faq"
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/leafcutter/faq")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="About"
|
|
|
|
|
href="/leafcutter/about"
|
|
|
|
|
Icon={AnalyticsIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/leafcutter/about")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
</List>
|
|
|
|
|
</Collapse>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Profile"
|
|
|
|
|
href="/profile"
|
|
|
|
|
Icon={PersonIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
selected={pathname.endsWith("/profile")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Admin"
|
|
|
|
|
href="/admin/zammad"
|
|
|
|
|
Icon={SettingsIcon}
|
|
|
|
|
iconSize={20}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<Collapse
|
|
|
|
|
in={pathname.startsWith("/admin/")}
|
|
|
|
|
timeout="auto"
|
|
|
|
|
unmountOnExit
|
|
|
|
|
onClick={undefined}
|
|
|
|
|
>
|
|
|
|
|
<List component="div" disablePadding>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Zammad Settings"
|
|
|
|
|
href="/admin/zammad"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/admin/zammad")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Metamigo"
|
|
|
|
|
href="/admin/metamigo"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/admin/metamigo")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
name="Label Studio"
|
|
|
|
|
href="/admin/label-studio"
|
|
|
|
|
Icon={FeaturedPlayListIcon}
|
|
|
|
|
iconSize={0}
|
|
|
|
|
selected={pathname.endsWith("/admin/label-studio")}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
</List>
|
|
|
|
|
</Collapse>
|
2023-06-07 08:02:29 +00:00
|
|
|
<MenuItem
|
|
|
|
|
name="Zammad Interface"
|
|
|
|
|
href="/proxy/zammad"
|
|
|
|
|
Icon={DvrIcon}
|
|
|
|
|
iconSize={20}
|
|
|
|
|
open={open}
|
|
|
|
|
target="_blank"
|
|
|
|
|
/>
|
2022-12-14 13:24:50 +01:00
|
|
|
<MenuItem
|
|
|
|
|
name="Logout"
|
|
|
|
|
href="/logout"
|
|
|
|
|
Icon={LogoutIcon}
|
|
|
|
|
iconSize={20}
|
2023-01-11 16:18:56 +01:00
|
|
|
open={open}
|
2023-06-07 08:02:29 +00:00
|
|
|
onClick={logout}
|
2022-12-14 13:24:50 +01:00
|
|
|
/>
|
|
|
|
|
</List>
|
|
|
|
|
</Grid>
|
2022-12-02 10:55:56 +00:00
|
|
|
</Grid>
|
2022-12-14 13:24:50 +01:00
|
|
|
</Drawer>
|
|
|
|
|
);
|
|
|
|
|
};
|