Rev 2875 | Rev 2964 | 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 { Search } from '@mui/icons-material'
import { debounce } from '@utils'
import { useFetch, useSearchQuery } from '@hooks'
import TitleSection from '@components/UI/TitleSection'
import Input from '@components/UI/inputs/Input'
import PaginationComponent from '@components/UI/PaginationComponent'
import PeopleViewedMyProfileList from '../../components/profile/PeopleViewedMyProfileList'
const PeopleViewedMyProfilePage = () => {
const labels = useSelector(({ intl }) => intl.labels)
const { getStringParams, setParam } = useSearchQuery()
const { data, isLoading, refetch } = useFetch(
'/profile/people-viewed-profile' + getStringParams()
)
const handleSearch = debounce((e) => setParam('search', e.target.value))
return (
<>
<TitleSection title={labels.who_has_seen_my_profile} />
<Input icon={<Search />} onChange={handleSearch} variant='search' />
<PeopleViewedMyProfileList profiles={data.current?.items} loading={isLoading} onComplete={refetch}/>
<PaginationComponent
isRow
pages={data.total?.pages}
currentActivePage={data.current?.page}
onChangePage={(page) => setParam('page', page)}
/>
</>
)
}
export default PeopleViewedMyProfilePage