Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 5489 | Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
5473 stevensc 1
/* eslint-disable react/prop-types */
2
import React, { useState } from 'react'
3
import EmptySection from '../../../../shared/empty-section/EmptySection'
4
import HobbiesModal from './HobbiesModal'
5
 
6
const HobbiesAndInterests = ({ userHobbiesAndInterests, hobbiesAndInterestsOptions, userIdEncrypted }) => {
7
  const [isModalOpen, setIsModalOpen] = useState(false)
8
  const [userHobbiesAndInterestsArray, setUserHobbiesAndInterestsArray] = useState(userHobbiesAndInterests)
9
 
10
  return (
11
    <>
12
      <div className="user-profile-ov">
13
        <h3>
14
          {LABELS.HOBBIES_AND_INTERESTS}
15
          <a
16
            href=""
17
            className="btn-hobbiesAndInterests-edit"
18
            onClick={() => setIsModalOpen(true)}
19
          >
20
            <i className="fa fa-pencil" />
21
          </a>
22
        </h3>
23
        <ul>
24
          {!userHobbiesAndInterestsArray.length
25
            ? <EmptySection align='left' message={LABELS.DATATABLE_EMPTY}/>
26
            : userHobbiesAndInterestsArray.map(({ name }) =>
27
              <li key={name}>
28
                <a href="#" title="">
29
                  {name}
30
                </a>
31
              </li>
32
            )}
33
        </ul>
34
      </div>
35
      <HobbiesModal
36
        show={isModalOpen}
37
        closeModal={() => setIsModalOpen(false)}
38
        userIdEncrypted={userIdEncrypted}
39
        hobbiesAndInterestsOptions={hobbiesAndInterestsOptions}
40
        userHobbiesAndInterests={userHobbiesAndInterestsArray}
41
        setUserHobbiesAndInterests={(newHobbiesAndInterests) => setUserHobbiesAndInterestsArray(newHobbiesAndInterests)}
42
      />
43
    </>
44
  )
45
}
46
 
47
export default HobbiesAndInterests