import React, { Fragment, useState } from 'react'; import List from "@mui/material/List"; import ListItem from "@mui/material/List"; import Collapse from "@mui/material/Collapse"; import Link from "next/link"; import { useTranslation } from 'next-i18next'; import { useRouter } from 'next/router'; import { changeLanguage } from '../../utils/commonFunction.utils'; const MobileMenu = () => { const router = useRouter() const { t } = useTranslation('menu'); // namespace: "menu.json" const [openId, setOpenId] = useState(0); const [menuActive, setMenuState] = useState(false); const ClickHandler = () => { window.scrollTo(10, 0); }; const handleLanguageChange = (e) => { const selectedLocale = e.target.value; changeLanguage(router, selectedLocale); }; const menus = [ { id: 1, title: t('home'), link: '/', }, { id: 4, title: t('ourApproach'), link: '/our-approach', }, { id: 2, title: t('aboutUs'), link: '/about', submenu: [ { id: 11, title: t('ourMission'), link: '/about/our-mission' }, { id: 12, title: t('racialJustice'), link: '/about/racial-justice' }, ] }, { id: 5, title: t('blog'), link: '/blog', }, { id: 3, title: t('services'), link: '/services', }, { id: 88, title: t('contact'), link: '/contact', } ]; return (
setOpenId(item.id === openId ? 0 : item.id)}>{item.title}