Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3416 | Rev 3694 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3416 Rev 3432
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
import { Search } from "@mui/icons-material";
3
import { Search } from '@mui/icons-material'
4
 
4
 
5
import { debounce } from "@utils";
5
import { debounce } from '@utils'
6
import { useFetch, useSearchQuery } from "@hooks";
6
import { useFetch, useSearchQuery } from '@hooks'
7
 
7
 
8
import TitleSection from "@components/UI/TitleSection";
8
import TitleSection from '@components/UI/TitleSection'
9
import Input from "@components/UI/inputs/Input";
9
import Input from '@components/UI/inputs/Input'
10
import Pagination from "@components/common/Pagination";
10
import Pagination from '@components/common/Pagination'
11
import PeopleViewedMyProfileList from "@components/profile/PeopleViewedMyProfileList";
11
import PeopleViewedMyProfileList from '@components/profile/PeopleViewedMyProfileList'
Línea 12... Línea 12...
12
 
12
 
13
const PeopleViewedMyProfilePage = () => {
13
const PeopleViewedMyProfilePage = () => {
Línea 14... Línea 14...
14
  const labels = useSelector(({ intl }) => intl.labels);
14
  const labels = useSelector(({ intl }) => intl.labels)
15
 
15
 
16
  const { getStringParams, setParam } = useSearchQuery();
16
  const { getStringParams, setParam } = useSearchQuery()
17
  const { data, loading, refetch } = useFetch(
17
  const { data, isLoading, refetch } = useFetch(
Línea 18... Línea 18...
18
    "/profile/people-viewed-profile" + getStringParams()
18
    '/profile/people-viewed-profile' + getStringParams()
Línea 19... Línea 19...
19
  );
19
  )
20
 
20
 
21
  const handleSearch = debounce((e) => setParam("search", e.target.value));
21
  const handleSearch = debounce((e) => setParam('search', e.target.value))
22
 
22
 
23
  return (
23
  return (
24
    <>
24
    <>
25
      <TitleSection title={labels.who_has_seen_my_profile} />
25
      <TitleSection title={labels.who_has_seen_my_profile} />
26
      <Input icon={<Search />} onChange={handleSearch} variant="search" />
26
      <Input icon={<Search />} onChange={handleSearch} variant='search' />
27
      <PeopleViewedMyProfileList
27
      <PeopleViewedMyProfileList
28
        profiles={data.current?.items}
28
        profiles={data.current?.items}
29
        loading={loading}
29
        loading={isLoading}
30
        onComplete={refetch}
30
        onComplete={refetch}
31
      />
31
      />
32
      <Pagination
32
      <Pagination
33
        page={data.current?.page}
33
        page={data.current?.page}
34
        pages={data.total?.pages}
34
        pages={data.total?.pages}
35
        onChange={(page) => setParam("page", page)}
35
        onChange={(page) => setParam('page', page)}
Línea 36... Línea 36...
36
      />
36
      />