Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2936 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 MyProfilesList({ profiles = [], loading, onComplete }) {
9
export default function MyProfilesList({ profiles = [], loading, onComplete }) {
10
  const labels = useSelector(({ intl }) => intl.labels)
10
  const labels = useSelector(({ intl }) => intl.labels);
11
 
11
 
12
  if (loading) {
12
  if (loading) {
13
    return <Spinner />
13
    return <Spinner />;
14
  }
14
  }
15
 
15
 
16
  if (!profiles.length) {
16
  if (!profiles.length) {
17
    return <EmptySection align='left' message={labels.datatable_szerorecords} />
17
    return <EmptySection align='left' message={labels.datatable_szerorecords} />;
18
  }
18
  }
19
 
19
 
20
  return (
20
  return (
21
    <ProfileCardsGrid>
21
    <ProfileCardsGrid>
22
      {profiles.map(({ id, ...rest }) => (
22
      {profiles.map(({ id, ...rest }) => (
23
        <ProfileItem
23
        <ProfileItem
24
          key={id}
24
          key={id}
25
          {...rest}
25
          {...rest}
26
          fetchCallback={onComplete}
26
          fetchCallback={onComplete}
27
          btnEditTitle='Editar perfil'
27
          btnEditTitle='Editar perfil'
28
          btnCancelTitle='Borrar perfil'
28
          btnCancelTitle='Borrar perfil'
29
        />
29
        />
30
      ))}
30
      ))}
31
    </ProfileCardsGrid>
31
    </ProfileCardsGrid>
32
  )
32
  );
33
}
33
}