Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
3028 stevensc 1
import React from 'react'
2
import { Box, IconButton, Typography } from '@mui/material'
3
import { Edit, Delete } from '@mui/icons-material'
4
 
5
import { parse } from '@utils'
6
import { getMonthName } from '@utils/dates'
7
 
8
export default function ExperienceItem({
9
  experience = {},
10
  onDelete = () => {},
11
  onEdit = () => {},
12
  edit = false
13
}) {
14
  const {
15
    title,
16
    description,
17
    company,
18
    size,
19
    industry,
20
    formatted_adress,
21
    from_month,
22
    from_year,
23
    to_month,
24
    to_year
25
  } = experience
26
  const industryName = typeof industry === 'object' ? industry.name : industry
27
 
28
  return (
29
    <Box
30
      sx={{
31
        display: 'flex',
32
        alignItems: 'start',
33
        justifyContent: 'space-between',
34
        gap: 2
35
      }}
36
    >
37
      <Box>
38
        <Typography variant='h4'>{title}</Typography>
39
        <Typography variant='body1' sx={{ fontSize: '14px' }}>
40
          {company}
41
        </Typography>
42
 
43
        <Typography
44
          variant='overline'
45
          sx={{ display: 'block' }}
46
        >{`${industryName} / ${size}`}</Typography>
47
 
48
        <Typography variant='overline' sx={{ display: 'block' }}>
49
          {`${getMonthName(from_month)} ${from_year}`} -{' '}
50
          {to_year ? `${getMonthName(to_month)} ${to_year}` : 'Actual'}
51
        </Typography>
52
 
53
        <Typography variant='overline' sx={{ display: 'block' }}>
54
          {formatted_adress}
55
        </Typography>
56
 
57
        {parse(description)}
58
      </Box>
59
 
60
      {edit && (
61
        <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>
3030 stevensc 62
          <IconButton onClick={onEdit}>
3028 stevensc 63
            <Edit />
64
          </IconButton>
3030 stevensc 65
          <IconButton onClick={onDelete}>
3028 stevensc 66
            <Delete />
67
          </IconButton>
68
        </Box>
69
      )}
70
    </Box>
71
  )
72
}