Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3426 | Rev 3428 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";

import { useApi } from "@hooks";
import { getCredentials, getLanguages } from "@services/auth";
import { labelsAdapter } from "./utils/labels";
import { setIntlLabels } from "./redux/intl/intl.action";
import { setCrendentials } from "./redux/auth/auth.actions";

import AppRoutes from "./routes/routes";
import ErrorPage from "./pages/error/error-page";
import Spinner from "./components/UI/Spinner";

import "./styles/globals.scss";

export default function App() {
  const {
    data: credentials,
    error: credentialsError,
    loading: loadingCredentials,
  } = useApi(getCredentials, {
    autofetch: true,
  });

  const loading = loadingCredentials;
  const initialError = credentialsError;

  if (loading) {
    return <Spinner />;
  }

  if (initialError) {
    return <ErrorPage />;
  }

  return (
    <>
      <h1>Heelo</h1>
    </>
  );
}