Rev 6847 | Rev 6861 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react'import { Link } from 'react-router-dom'import Badge from '../../UI/Badge'const ListItemDropdown = ({ options = [], isShow }) => {if (!options.length) return nullreturn (<nav className={`nav__options-dropdown ${isShow && 'show'}`}><ul>{options.map(({ label, href, childs, count }, index) => (<li key={index}><Linkto={href[0] === '/' ? href : `/${href}`}onClick={(e) => childs.length && e.preventDefault()}>{label}{Boolean(count) && (<Badge count={count} className="position-relative" />)}</Link>{Boolean(childs?.length) && (<nav className="navigation-level_three"><ul>{childs?.map((optionsChild, index) => (<li key={index}><Link href={`/${optionsChild.href}`} target="framename">{optionsChild.label}</Link></li>))}</ul></nav>)}</li>))}</ul></nav>)}export default ListItemDropdown