import React, { useState, useEffect } from "react"; import { styled } from "@mui/material/styles"; import Link from "next/link"; import styles from "@/components/_App/LeftSidebar/SubMenu.module.css"; import { useRouter } from "next/router"; const SidebarLabel = styled("span")(({ theme }) => ({ position: "relative", top: "-3px", })); const SubMenu = ({ item }) => { const [subnav, setSubnav] = useState(false); const showSubnav = () => setSubnav(!subnav); const [currentPath, setCurrentPath] = useState(""); const router = useRouter(); // console.log(router.asPath) useEffect(() => { setCurrentPath(router.asPath); }, [router]); return ( <>