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 TitleSection from '@components/UI/TitleSection';
9
import Input from '@components/UI/inputs/Input';
10
import Pagination from '@components/common/Pagination';
11
import PeopleViewedMyProfileList from '@components/profile/PeopleViewedMyProfileList';
12
 
13
const PeopleViewedMyProfilePage = () => {
14
  const labels = useSelector(({ intl }) => intl.labels);
15
 
16
  const { getStringParams, setParam } = useSearchQuery();
17
  const { data, isLoading, refetch } = useFetch(
18
    '/profile/people-viewed-profile' + getStringParams()
19
  );
20
 
21
  const handleSearch = debounce((e) => setParam('search', e.target.value));
22
 
23
  return (
24
    <>
25
      <TitleSection title={labels.who_has_seen_my_profile} />
26
      <Input icon={<Search />} onChange={handleSearch} variant='search' />
27
      <PeopleViewedMyProfileList
28
        profiles={data.current?.items}
29
        loading={isLoading}
30
        onComplete={refetch}
31
      />
32
      <Pagination
33
        page={data.current?.page}
34
        pages={data.total?.pages}
35
        onChange={(page) => setParam('page', page)}
36
      />
37
    </>
38
  );
39
};
40
 
41
export default PeopleViewedMyProfilePage;