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 InvitationsReceivedList({ 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 key={id} {...rest} fetchCallback={onComplete} btnCancelTitle='Eliminar' />
|
|
|
24 |
))}
|
|
|
25 |
</ProfileCardsGrid>
|
|
|
26 |
);
|
|
|
27 |
}
|