Rev 7085 | 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'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}><Link to={href[0] === '/' ? href : `/${href}`}>{label}{Boolean(count) && ` | ${count}`}</Link>{Boolean(childs?.length) && (<nav className="navigation-level_three"><ul>{childs?.map((optionsChild, index) => (<li key={index}><Link to={`/${optionsChild.href}`}>{optionsChild.label}</Link></li>))}</ul></nav>)}</li>))}</ul></nav>)}export default ListItemDropdown