Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6912 | Rev 7238 | 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
 
6840 stevensc 4
import Badge from '../../UI/Badge'
6632 stevensc 5
 
6
const ListItemDropdown = ({ options = [], isShow }) => {
7
  if (!options.length) return null
6842 stevensc 8
 
6632 stevensc 9
  return (
10
    <nav className={`nav__options-dropdown ${isShow && 'show'}`}>
11
      <ul>
6798 stevensc 12
        {options.map(({ label, href, childs, count }, index) => (
6632 stevensc 13
          <li key={index}>
7085 stevensc 14
            <Link to={href[0] === '/' ? href : `/${href}`}>
6798 stevensc 15
              {label}
6848 stevensc 16
              {Boolean(count) && (
6847 stevensc 17
                <Badge count={count} className="position-relative" />
18
              )}
6798 stevensc 19
            </Link>
6843 stevensc 20
            {Boolean(childs?.length) && (
6632 stevensc 21
              <nav className="navigation-level_three">
22
                <ul>
6798 stevensc 23
                  {childs?.map((optionsChild, index) => (
6632 stevensc 24
                    <li key={index}>
6861 stevensc 25
                      <Link to={`/${optionsChild.href}`}>
6632 stevensc 26
                        {optionsChild.label}
6797 stevensc 27
                      </Link>
6632 stevensc 28
                    </li>
29
                  ))}
30
                </ul>
31
              </nav>
32
            )}
33
          </li>
34
        ))}
35
      </ul>
36
    </nav>
37
  )
38
}
39
 
40
export default ListItemDropdown