Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3030 | Rev 3694 | 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',
3040 stevensc 34
        gap: 2,
35
        marginBottom: 1
3028 stevensc 36
      }}
37
    >
38
      <Box>
39
        <Typography variant='h4'>{title}</Typography>
40
        <Typography variant='body1' sx={{ fontSize: '14px' }}>
41
          {company}
42
        </Typography>
43
 
44
        <Typography
45
          variant='overline'
46
          sx={{ display: 'block' }}
47
        >{`${industryName} / ${size}`}</Typography>
48
 
49
        <Typography variant='overline' sx={{ display: 'block' }}>
50
          {`${getMonthName(from_month)} ${from_year}`} -{' '}
51
          {to_year ? `${getMonthName(to_month)} ${to_year}` : 'Actual'}
52
        </Typography>
53
 
54
        <Typography variant='overline' sx={{ display: 'block' }}>
55
          {formatted_adress}
56
        </Typography>
57
 
58
        {parse(description)}
59
      </Box>
60
 
61
      {edit && (
62
        <Box sx={{ display: 'flex', gap: 1, alignItems: 'center' }}>
3030 stevensc 63
          <IconButton onClick={onEdit}>
3028 stevensc 64
            <Edit />
65
          </IconButton>
3030 stevensc 66
          <IconButton onClick={onDelete}>
3028 stevensc 67
            <Delete />
68
          </IconButton>
69
        </Box>
70
      )}
71
    </Box>
72
  )
73
}