Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
2864 stevensc 1
import React from 'react'
2
import { useSelector } from 'react-redux'
3
 
4
import Spinner from '@components/UI/Spinner'
5
import EmptySection from '@components/UI/EmptySection'
6
import ProfileItem from '@components/profile/ProfileItem'
7
 
8
export default function CompanyInvitationsReceivedList({
9
  companies = [],
10
  loading,
11
  onComplete
12
}) {
13
  const labels = useSelector(({ intl }) => intl.labels)
14
 
15
  if (loading) {
16
    return <Spinner />
17
  }
18
 
19
  if (!companies.length) {
20
    return <EmptySection align='left' message={labels.datatable_szerorecords} />
21
  }
22
 
23
  return (
24
    <ul className='companies-list'>
25
      {companies.map(({ id, link_my_company, ...rest }) => (
26
        <ProfileItem
27
          key={id}
28
          fetchCallback={onComplete}
29
          btnAcceptTitle={labels.view_company}
30
          btnCancelTitle={labels.request_cancel}
31
          {...rest}
32
        />
33
      ))}
34
    </ul>
35
  )
36
}