Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3694 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 stevensc 1
import React from 'react';
2
import Delete from '@mui/icons-material/Delete';
3
import Edit from '@mui/icons-material/Edit';
4
import { Box, IconButton, Typography } from '@mui/material';
5
 
6
import { parse } from '@utils';
7
 
8
export default function EducationItem({
9
  education = {},
10
  onDelete = () => {},
11
  onEdit = () => {},
12
  edit = false
13
}) {
14
  const { university, field_of_study, degree, from_year, to_year, formatted_address, description } =
15
    education;
16
 
17
  return (
18
    <Box
19
      sx={{
20
        display: 'flex',
21
        alignItems: 'start',
22
        justifyContent: 'space-between',
23
        gap: 2
24
      }}
25
    >
26
      <Box>
27
        <Typography variant='h4'>{university}</Typography>
28
 
29
        <Typography variant='body1' sx={{ fontSize: '14px' }}>
30
          {field_of_study}
31
        </Typography>
32
 
33
        <Typography variant='body1'>{`${field_of_study} - ${degree}`}</Typography>
34
 
35
        <Typography
36
          variant='overline'
37
          sx={{ display: 'block' }}
38
        >{`${from_year} -  ${to_year || 'Actual'}`}</Typography>
39
 
40
        <Typography variant='overline' sx={{ display: 'block' }}>
41
          {formatted_address}
42
        </Typography>
43
        {parse(description)}
44
      </Box>
45
 
46
      {edit && (
47
        <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>
48
          <IconButton onClick={onEdit}>
49
            <Edit />
50
          </IconButton>
51
          <IconButton onClick={onDelete}>
52
            <Delete />
53
          </IconButton>
54
        </Box>
55
      )}
56
    </Box>
57
  );
58
}