Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3571 Rev 3659
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useParams } from 'react-router-dom';
2
import { useParams } from 'react-router-dom';
3
import { Link } from 'react-router-dom';
3
import { Link } from 'react-router-dom';
Línea 4... Línea 4...
4
 
4
 
-
 
5
import { useAlert, useApi } from '@shared/hooks';
Línea 5... Línea 6...
5
import { useFetch } from '@shared/hooks';
6
import { getTopic } from '@microlearning/services';
6
 
7
 
Línea 7... Línea 8...
7
import { Grid, PageHeader, Spinner } from '@shared/components';
8
import { Grid, PageHeader, Spinner } from '@shared/components';
8
import { CapsuleCard } from '@microlearning/components';
9
import { CapsuleCard } from '@microlearning/components';
-
 
10
 
-
 
11
export function TopicPage() {
-
 
12
  const { uuid } = useParams();
9
 
13
 
-
 
14
  const { showError } = useAlert();
-
 
15
 
-
 
16
  const { data: topic, loading } = useApi(getTopic, {
-
 
17
    autoFetch: true,
-
 
18
    autoFetchArgs: [uuid],
-
 
19
    onError: (error) => {
Línea 10... Línea 20...
10
export function TopicPage() {
20
      showError(error.message);
Línea 11... Línea 21...
11
  const { topicUuid } = useParams();
21
    }
12
  const { data: topic, loading } = useFetch(`/microlearning/topic/${topicUuid}`);
22
  });