Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3694 | | 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 Search from '@mui/icons-material/Search';
3
import { useSelector } from 'react-redux';
4
 
5
import { debounce } from '@utils';
6
import { useFetch, useSearchQuery } from '@hooks';
7
 
8
import Input from '@components/UI/inputs/Input';
9
import TitleSection from '@components/UI/TitleSection';
10
import Pagination from '@components/common/Pagination';
11
import PeopleYouMayKnowList from '@components/connections/PeopleYouMayKnowList';
12
 
13
const PeopleYouMayKnowPage = () => {
14
  const labels = useSelector(({ intl }) => intl.labels);
15
 
16
  const { getStringParams, setParam } = useSearchQuery();
17
  const { data, isLoading, refetch } = useFetch(
18
    '/connection/people-you-may-know' + getStringParams()
19
  );
20
 
21
  const handleSearch = debounce((e) => setParam('search', e.target.value));
22
 
23
  return (
24
    <>
25
      <TitleSection title={labels.people_you_may_know} />
26
      <Input icon={<Search />} onChange={handleSearch} variant='search' />
27
      <PeopleYouMayKnowList
28
        connections={data.current?.items}
29
        loading={isLoading}
30
        onComplete={refetch}
31
      />
32
 
33
      <Pagination
34
        pages={data.total?.pages}
35
        page={data.current?.page}
36
        onChange={(page) => setParam('page', page)}
37
      />
38
    </>
39
  );
40
};
41
 
42
export default PeopleYouMayKnowPage;