Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev Autor Línea Nro. Línea
3694 stevensc 1
import React, { useState } from 'react';
2
import Search from '@mui/icons-material/Search';
3
import { Box, styled } from '@mui/material';
4
import { useSelector } from 'react-redux';
2864 stevensc 5
 
3694 stevensc 6
import { debounce } from '@utils';
7
import { useFetch, useSearchQuery } from '@hooks';
2864 stevensc 8
 
3694 stevensc 9
import Input from '@components/UI/inputs/Input';
10
import TitleSection from '@components/UI/TitleSection';
11
import CompaniesIFollowList from '@components/company/CompaniesIFollowList';
2864 stevensc 12
 
13
export default function CompaniesIFollowPage() {
3694 stevensc 14
  const labels = useSelector(({ intl }) => intl.labels);
2864 stevensc 15
 
3694 stevensc 16
  const { getStringParams, setParam } = useSearchQuery();
2864 stevensc 17
  const {
18
    data: companies,
3432 stevensc 19
    isLoading,
20
    refetch
3694 stevensc 21
  } = useFetch('/company/following-companies' + getStringParams());
2864 stevensc 22
 
3694 stevensc 23
  const handleSearch = debounce((e) => setParam('search', e.target.value));
2864 stevensc 24
 
25
  return (
26
    <>
27
      <TitleSection title={labels.companies_i_follow} />
3432 stevensc 28
      <Input icon={<Search />} onChange={handleSearch} variant='search' />
3694 stevensc 29
      <CompaniesIFollowList companies={companies} loading={isLoading} onComplete={refetch} />
2864 stevensc 30
    </>
3694 stevensc 31
  );
2864 stevensc 32
}