import type { FC } from 'react';
import { useEffect } from 'react';

import NProgress from 'nprogress';

import Box from '@material-hu/mui/Box';

const LoadingScreen: FC = () => {
  useEffect(() => {
    NProgress.start();

    return (): void => {
      NProgress.done();
    };
  }, []);

  return (
    <Box
      sx={{
        backgroundColor: theme => theme.palette.new.background.elements.default,
        minHeight: '100%',
      }}
    />
  );
};

export default LoadingScreen;
