import { useState } from 'react' import { useRouter } from 'next/router' import Link from 'next/link' import { AaveMonoIcon, BtcMonoIcon, CopeMonoIcon, DogeMonoIcon, EthMonoIcon, FidaMonoIcon, FttMonoIcon, MediaMonoIcon, MerMonoIcon, MngoMonoIcon, RayMonoIcon, SolMonoIcon, SrmMonoIcon, StepMonoIcon, SushiMonoIcon, UniMonoIcon, UsdtMonoIcon, } from './icons' const symbolIcons = { AaveMonoIcon, BtcMonoIcon, CopeMonoIcon, DogeMonoIcon, EthMonoIcon, FidaMonoIcon, FttMonoIcon, MediaMonoIcon, MerMonoIcon, MngoMonoIcon, RayMonoIcon, SolMonoIcon, SrmMonoIcon, StepMonoIcon, SushiMonoIcon, UniMonoIcon, UsdtMonoIcon, } export default function MarketMenuItem({ menuTitle = '', linksArray = [] }) { const { asPath } = useRouter() const [openState, setOpenState] = useState(false) const iconName = `${menuTitle.substr(0, 1)}${menuTitle .substr(1, 4) .toLowerCase()}MonoIcon` const SymbolIcon = symbolIcons[iconName] const onHover = (open, action) => { if ( (!open && action === 'onMouseEnter') || (open && action === 'onMouseLeave') ) { setOpenState((openState) => !openState) } } return (