Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev Autor Línea Nro. Línea
5478 stevensc 1
import React, { useState } from 'react'
2
import parse from 'html-react-parser'
3
 
4
import IconButton from '@mui/material/IconButton'
5
import EditIcon from '@mui/icons-material/Edit'
6
import ConfirmationBox from '../../../shared/confirmation-box/ConfirmationBox'
7
 
8
const EducationItem = ({ education, onDelete, onEdit, isEdit }) => {
9
  const [isShowModal, setIsShowModal] = useState(false)
10
 
11
  const toggleConfirmModal = () => {
12
    setIsShowModal(!isShowModal)
13
  }
14
 
15
  return (
16
    <>
17
      <div className="education-item">
18
        <div className="education-item-header">
5481 stevensc 19
          <h3>{education.degree}</h3>
5478 stevensc 20
          {isEdit && (
5496 stevensc 21
            <div className="d-inline-flex align-items-center gap-2">
5478 stevensc 22
              <IconButton onClick={() => onEdit(education.link_edit)}>
23
                <EditIcon />
24
              </IconButton>
25
              <IconButton onClick={toggleConfirmModal}>
26
                <EditIcon />
27
              </IconButton>
28
            </div>
29
          )}
30
        </div>
5481 stevensc 31
        <h4>{education.university}</h4>
5478 stevensc 32
        <p>{`${education.from_year} - ${
33
          education.to_year ? education.to_year : 'Actualidad'
34
        }`}</p>
35
        {education.field_of_study && <p>{education.field_of_study}</p>}
36
        <p>{education.formatted_address}</p>
37
        {education.description && parse(education.description)}
38
      </div>
39
      <ConfirmationBox
40
        show={isShowModal}
41
        onClose={toggleConfirmModal}
42
        onAccept={() => onDelete(education.link_delete)}
43
      />
44
    </>
45
  )
46
}
47
 
48
export default EducationItem