Proyectos de Subversion LeadersLinked - SPA

Rev

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

import React from "react";

import { useCredentials, useLanguages } from "@hooks";

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

import "./styles/globals.scss";

function App() {
  const { loading: loadingCredentials, error: credentialsError } =
    useCredentials();
  const { loading: loadingLanguages, error: languagesError } = useLanguages();

  const loading = loadingCredentials || loadingLanguages;
  const initialError = credentialsError || languagesError;

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

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

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

export default App;