Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
968 stevensc 1
import React, { useMemo } from 'react'
966 stevensc 2
import { Link } from 'react-router-dom'
967 stevensc 3
import { Avatar, Box } from '@mui/material'
966 stevensc 4
import { Visibility, Group, Share } from '@mui/icons-material'
5 stevensc 5
 
966 stevensc 6
import TagsList from '../UI/TagsList'
7
import StyledContainer from '../widgets/WidgetLayout'
968 stevensc 8
import Paraphrase from '../UI/Paraphrase'
5 stevensc 9
 
10
const SearchItem = ({
11
  name,
12
  industry,
13
  description,
14
  skills,
15
  common_connection,
16
  views,
17
  image,
18
  company_name,
19
  title,
20
  url,
21
  followers,
22
  company_size,
892 stevensc 23
  view_common_connection
5 stevensc 24
}) => {
974 stevensc 25
  const userSkills = useMemo(() => {
26
    if (!skills) {
27
      return []
28
    }
968 stevensc 29
 
974 stevensc 30
    return Object.entries(skills).map((skill) => {
31
      return { value: skill[0], name: skill[1] }
32
    })
33
  }, [skills])
34
 
5 stevensc 35
  return (
966 stevensc 36
    <StyledContainer>
967 stevensc 37
      <StyledContainer.Body>
968 stevensc 38
        <Box
39
          display='flex'
40
          justifyContent='space-between'
41
          alignItems='flex-start'
42
        >
43
          <Box display='inline-flex' alignItems='center' gap={1}>
967 stevensc 44
            <Avatar src={image} sx={{ width: 60, height: 60 }} />
5 stevensc 45
 
967 stevensc 46
            <Box display='flex' flexDirection='column'>
47
              <Link to={url}>
48
                <h2>{title || name}</h2>
49
              </Link>
50
              {company_name && <h4>{company_name}</h4>}
51
              {company_size && <p>Empresa {company_size}</p>}
52
              {industry && <p>{industry}</p>}
53
            </Box>
54
          </Box>
55
 
968 stevensc 56
          <Box display='inline-flex' alignItems='center' gap={1}>
967 stevensc 57
            {!company_name && view_common_connection && (
58
              <span>
59
                <Share />
60
                {common_connection} comunes
61
              </span>
62
            )}
63
 
64
            {followers ? (
65
              <span>
66
                <Group />
67
                {followers}
68
              </span>
69
            ) : null}
70
 
71
            {views ? (
72
              <span>
73
                <Visibility />
74
                {views}
75
              </span>
76
            ) : null}
77
          </Box>
78
        </Box>
79
 
968 stevensc 80
        <Paraphrase>{description || ''}</Paraphrase>
967 stevensc 81
 
968 stevensc 82
        <TagsList tags={userSkills} />
967 stevensc 83
      </StyledContainer.Body>
966 stevensc 84
    </StyledContainer>
5 stevensc 85
  )
86
}
87
 
88
export default SearchItem