import { Stack, Typography } from "@mui/material"; import { useLocation, useNavigate } from "react-router"; import { useTheme } from "@emotion/react"; import BWULogo from "../../assets/Images/bwl-logo.svg?react"; import Support from "../../assets/icons/support.svg?react"; import StatusPages from "../../assets/icons/status-pages.svg?react"; import Maintenance from "../../assets/icons/maintenance.svg?react"; import Monitors from "../../assets/icons/monitors.svg?react"; import Incidents from "../../assets/icons/incidents.svg?react"; import Integrations from "../../assets/icons/integrations.svg?react"; import PageSpeed from "../../assets/icons/page-speed.svg?react"; import Settings from "../../assets/icons/settings.svg?react"; import "./index.css"; /** * @component * Sidebar component serves as a sidebar containing a menu. * * @returns {JSX.Element} The JSX element representing the Sidebar component. */ const menu = [ { name: "Monitors", path: "monitors", icon: }, { name: "Incidents", path: "incidents", icon: }, { name: "Status pages", path: "status", icon: }, { name: "Maintenance", path: "maintenance", icon: }, { name: "Page speed", path: "page-speed", icon: }, { name: "Integrations", path: "integrations", icon: }, { name: "Support", path: "support", icon: }, { name: "Settings", path: "settings", icon: }, ]; function Sidebar() { const theme = useTheme(); const navigate = useNavigate(); const location = useLocation(); return ( {menu.map((item) => ( item.path === "support" ? window.open( "https://github.com/bluewave-labs/bluewave-uptime", "_blank", "noreferrer" ) : navigate(`/${item.path}`) } sx={{ p: `${theme.gap.small} ${theme.gap.medium}` }} > {item.icon} {item.name} ))} ); } export default Sidebar;