'use client' import Image from 'next/image'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import React , {useState,useEffect} from 'react' export const menuList = [ { title: "Bread Agency", links: [ { label: "Home", href: "/", }, { label: "Performance", href: "/performance", }, { label: "Content", href: "/content", }, // { // label: "Doc landing", // href: "/doc-landing", // }, // { // label: "Product landing", // href: "/product-landing", // }, ], }, ]; export default function MobileMenuTwo() { const [showMenu, setShowMenu] = useState(false); const [menuNesting, setMenuNesting] = useState([]); const [menuItem, setMenuItem] = useState(""); const [submenu, setSubmenu] = useState(""); const pathname = usePathname(); useEffect(() => { menuList.forEach((elm) => { elm?.links?.forEach((elm2) => { if (elm2.href == pathname) { setMenuItem(elm.title); } else { elm2?.links?.map((elm3) => { if (elm3.href == pathname) { setMenuItem(elm.title); setSubmenu(elm2.title); } }); } }); }); }, []); return ( <>