| 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">
|
|
|
19 |
<h4>{education.degree}</h4>
|
|
|
20 |
{isEdit && (
|
|
|
21 |
<div className="d-inline-flex align-items-center gap-3">
|
|
|
22 |
<IconButton onClick={() => onEdit(education.link_edit)}>
|
|
|
23 |
<EditIcon />
|
|
|
24 |
</IconButton>
|
|
|
25 |
<IconButton onClick={toggleConfirmModal}>
|
|
|
26 |
<EditIcon />
|
|
|
27 |
</IconButton>
|
|
|
28 |
</div>
|
|
|
29 |
)}
|
|
|
30 |
</div>
|
|
|
31 |
<p>{education.university}</p>
|
|
|
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
|