Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2880 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

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