Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2936 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 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
import ProfileCardsGrid from '@components/UI/ProfileCardsGrid';
8
 
9
export default function MyConnectionsList({ connections = [], loading, onComplete }) {
10
  const labels = useSelector(({ intl }) => intl.labels);
11
 
12
  if (loading) {
13
    return <Spinner />;
14
  }
15
 
16
  if (!connections.length) {
17
    return <EmptySection align='left' message={labels.datatable_szerorecords} />;
18
  }
19
 
20
  return (
21
    <ProfileCardsGrid>
22
      {connections.map(({ id, ...rest }) => (
23
        <ProfileItem
24
          key={id}
25
          {...rest}
26
          isTopData
27
          fetchCallback={onComplete}
28
          btnCancelTitle='Eliminar'
29
        />
30
      ))}
31
    </ProfileCardsGrid>
32
  );
33
}