import React, { useEffect, useState } from "react";
import { ThemeProvider } from "next-themes";

import "../styles/main.sass";
import LoadingScreen from "components/LoadingScreen";

function MyApp({ Component, pageProps }) {
  const [loading, setLoading] = useState(true)
  useEffect(() => setLoading(false), [])

  return (

    <ThemeProvider>
      <LoadingScreen isLoading={loading} />
      <Component {...pageProps} />
    </ThemeProvider>

  );
}

export default MyApp;
