import { ApolloProvider } from "@apollo/client";
import React, { useState } from "react";
import { apolloClient } from "./apolloClient";
import { MetricDetailsPage } from "./pages";
import { RenewToken } from "./containers";

export const App: React.FC = () => {
  const [authReady, setAuthReady] = useState<boolean>(false);
  return (
    <ApolloProvider client={apolloClient}>
      <RenewToken onReady={() => setAuthReady(true)} />
      {authReady ? <MetricDetailsPage /> : null}
    </ApolloProvider>
  );
};
