Proyectos de Subversion LeadersLinked - SPA

Rev

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

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