import * as React from "react"; import { Box } from "@mui/material"; import { useNavigate, useLocation } from "react-router-dom"; import MenuOutlinedIcon from '@mui/icons-material/MenuOutlined'; import PersonOutlineOutlinedIcon from '@mui/icons-material/PersonOutlineOutlined'; import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined'; import BathtubOutlinedIcon from '@mui/icons-material/BathtubOutlined'; import AddPhotoAlternateOutlinedIcon from '@mui/icons-material/AddPhotoAlternateOutlined'; import NaturePeopleOutlinedIcon from '@mui/icons-material/NaturePeopleOutlined'; import SettingsIcon from '@mui/icons-material/Settings'; import CameraIcon from '@mui/icons-material/Camera'; import HeadsetMicOutlinedIcon from '@mui/icons-material/HeadsetMicOutlined'; import theme from "../../../theme"; const Menu: React.FC = () => { const navigate = useNavigate(); const pages = [ "null", "users", "entities", "tariffs", "discounts", "promocode", "null", "null", "support" ]; const colors = [ "null", theme.palette.golden.main, theme.palette.golden.main, theme.palette.golden.main, theme.palette.golden.main, theme.palette.golden.main, theme.palette.golden.main, theme.palette.golden.main, theme.palette.golden.main ]; const location = useLocation(); pages.forEach( (item, i) => { if( location.pathname == `/${pages[i]}` ) colors[ i ] = theme.palette.secondary.main } ); const changePage = (page:number) => { navigate(`/${pages[ page ]}`); } return ( changePage( 1 ) }> changePage( 2 ) }> changePage( 3 ) }> changePage( 4 ) }> changePage( 5 ) }> changePage( 6 ) }> changePage( 7 ) }> changePage( 8 ) }> ); } export default Menu;