Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 2800 Rev 2806
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState } from 'react'
2
import { useSelector } from 'react-redux'
2
import { useSelector } from 'react-redux'
3
import { Container } from '@mui/material'
-
 
Línea 4... Línea 3...
4
 
3
 
5
import { useFetch } from '@hooks'
4
import { useFetch } from '@hooks'
Línea 6... Línea 5...
6
import { debounce } from '@app/utils'
5
import { debounce } from '@app/utils'
Línea 27... Línea 26...
27
 
26
 
Línea 28... Línea 27...
28
  const handleSearch = debounce((value) => setSearch(value), 500)
27
  const handleSearch = debounce((value) => setSearch(value), 500)
29
 
28
 
30
  return (
-
 
31
    <>
29
  return (
32
      <Container>
30
    <>
33
        <TitleSection
31
      <TitleSection
34
          title={labels.my_companies}
32
        title={labels.my_companies}
35
          onAdd={toggleShowCompanyModal}
33
        onAdd={toggleShowCompanyModal}
36
          addLabel={`${labels.add} ${labels.company?.toLowerCase()}`}
34
        addLabel={`${labels.add} ${labels.company?.toLowerCase()}`}
37
        />
35
      />
38
 
36
 
39
        <SearchBar onChange={handleSearch} />
37
      <SearchBar onChange={handleSearch} />
40
 
38
 
41
        <ul className='companies-list'>
39
      <ul className='companies-list'>
42
          {isLoading ? <Spinner /> : null}
40
        {isLoading ? <Spinner /> : null}
43
          {companies.length ? (
41
        {companies.length ? (
44
            companies.map(({ id, link_my_company, ...rest }) => (
42
          companies.map(({ id, link_my_company, ...rest }) => (
45
              <ProfileItem
43
            <ProfileItem
46
                key={id}
44
              key={id}
47
                link_admin={link_my_company}
45
              link_admin={link_my_company}
48
                btnAcceptTitle={labels.view_company}
-
 
49
                {...rest}
-
 
50
              />
-
 
51
            ))
-
 
52
          ) : (
-
 
53
            <EmptySection
-
 
54
              align='left'
46
              btnAcceptTitle={labels.view_company}
55
              message={labels.datatable_szerorecords}
47
              {...rest}
56
            />
48
            />
-
 
49
          ))
-
 
50
        ) : (
57
          )}
51
          <EmptySection align='left' message={labels.datatable_szerorecords} />
-
 
52
        )}
58
        </ul>
53
      </ul>
59
      </Container>
54
 
60
      <AddCompanyModal
55
      <AddCompanyModal
61
        show={showCompanyModal}
56
        show={showCompanyModal}
62
        onHide={toggleShowCompanyModal}
57
        onHide={toggleShowCompanyModal}