Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7085 | Rev 7273 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6632 stevensc 1
import React from 'react'
6797 stevensc 2
import { Link } from 'react-router-dom'
6861 stevensc 3
 
6632 stevensc 4
const ListItemDropdown = ({ options = [], isShow }) => {
5
  if (!options.length) return null
6842 stevensc 6
 
6632 stevensc 7
  return (
8
    <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
9
      <ul>
6798 stevensc 10
        {options.map(({ label, href, childs, count }, index) => (
6632 stevensc 11
          <li key={index}>
7085 stevensc 12
            <Link to={href[0] === '/' ? href : `/${href}`}>
6798 stevensc 13
              {label}
7238 stevensc 14
              {Boolean(count) && ` | ${count}`}
6798 stevensc 15
            </Link>
6843 stevensc 16
            {Boolean(childs?.length) && (
6632 stevensc 17
              <nav className="navigation-level_three">
18
                <ul>
6798 stevensc 19
                  {childs?.map((optionsChild, index) => (
6632 stevensc 20
                    <li key={index}>
6861 stevensc 21
                      <Link to={`/${optionsChild.href}`}>
6632 stevensc 22
                        {optionsChild.label}
6797 stevensc 23
                      </Link>
6632 stevensc 24
                    </li>
25
                  ))}
26
                </ul>
27
              </nav>
28
            )}
29
          </li>
30
        ))}
31
      </ul>
32
    </nav>
33
  )
34
}
35
 
36
export default ListItemDropdown