Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2934 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import React from 'react'
import { useSelector } from 'react-redux'

import Spinner from '@components/UI/Spinner'
import EmptySection from '@components/UI/EmptySection'
import ProfileItem from '@components/profile/ProfileItem'
import ProfileCardsGrid from '@components/UI/ProfileCardsGrid'

export default function PeopleViewedMyProfileList({
  profiles = [],
  loading,
  onComplete
}) {
  const labels = useSelector(({ intl }) => intl.labels)

  if (loading) {
    return <Spinner />
  }

  if (!profiles.length) {
    return <EmptySection align='left' message={labels.datatable_szerorecords} />
  }

  return (
    <ProfileCardsGrid>
      {profiles.map(({ id, ...rest }) => (
        <ProfileItem key={id} {...rest} fetchCallback={onComplete} />
      ))}
    </ProfileCardsGrid>
  )
}