Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3527 Rev 3661
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { Link } from 'react-router-dom';
2
import { Link } from 'react-router-dom';
Línea 3... Línea 3...
3
 
3
 
-
 
4
import { useAlert, useApi } from '@shared/hooks';
Línea 4... Línea 5...
4
import { useFetch } from '@shared/hooks';
5
import { getCompanies } from '@microlearning/services';
5
 
6
 
Línea 6... Línea 7...
6
import { PageHeader, Spinner, Grid } from '@shared/components';
7
import { PageHeader, Spinner, Grid } from '@shared/components';
7
import { CompanyItem } from '@microlearning/components';
8
import { CompanyItem } from '@microlearning/components';
Línea 8... Línea 9...
8
 
9
 
-
 
10
export function CompaniesPage() {
9
export function CompaniesPage() {
11
  const { showError } = useAlert();
-
 
12
 
-
 
13
  const { data: companies, loading } = useApi(getCompanies, {
10
  const { data: companies, loading } = useFetch('/microlearning/companies');
14
    autoFetch: true,
-
 
15
    onError: (error) => {
-
 
16
      showError(error.message);
Línea 11... Línea 17...
11
 
17
    }
12
  if (loading || !companies) {
18
  });
13
    return <Spinner />;
19
 
14
  }
20
  if (loading) return <Spinner />;