Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 968 | Rev 974 | 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
}) => {
968 stevensc 25
  const userSkills = useMemo(
26
    () =>
969 stevensc 27
      Object.entries(skills).map((skill) => {
968 stevensc 28
        return { value: skill[0], name: skill[1] }
29
      }),
30
    [skills]
31
  )
32
 
5 stevensc 33
  return (
966 stevensc 34
    <StyledContainer>
967 stevensc 35
      <StyledContainer.Body>
968 stevensc 36
        <Box
37
          display='flex'
38
          justifyContent='space-between'
39
          alignItems='flex-start'
40
        >
41
          <Box display='inline-flex' alignItems='center' gap={1}>
967 stevensc 42
            <Avatar src={image} sx={{ width: 60, height: 60 }} />
5 stevensc 43
 
967 stevensc 44
            <Box display='flex' flexDirection='column'>
45
              <Link to={url}>
46
                <h2>{title || name}</h2>
47
              </Link>
48
              {company_name && <h4>{company_name}</h4>}
49
              {company_size && <p>Empresa {company_size}</p>}
50
              {industry && <p>{industry}</p>}
51
            </Box>
52
          </Box>
53
 
968 stevensc 54
          <Box display='inline-flex' alignItems='center' gap={1}>
967 stevensc 55
            {!company_name && view_common_connection && (
56
              <span>
57
                <Share />
58
                {common_connection} comunes
59
              </span>
60
            )}
61
 
62
            {followers ? (
63
              <span>
64
                <Group />
65
                {followers}
66
              </span>
67
            ) : null}
68
 
69
            {views ? (
70
              <span>
71
                <Visibility />
72
                {views}
73
              </span>
74
            ) : null}
75
          </Box>
76
        </Box>
77
 
968 stevensc 78
        <Paraphrase>{description || ''}</Paraphrase>
967 stevensc 79
 
968 stevensc 80
        <TagsList tags={userSkills} />
967 stevensc 81
      </StyledContainer.Body>
966 stevensc 82
    </StyledContainer>
5 stevensc 83
  )
84
}
85
 
86
export default SearchItem