import { CssBaseline } from '@mui/material';
import './App.css';
import { LanguageManager } from '@/components/LanguageManager';
import { RouterProvider } from 'react-router-dom';
import { router } from '@/routes';
import { useAuth } from './hooks/useAuth';
import { Loading } from './components/Loading';

function App() {
  const { authFinished } = useAuth();

  if (authFinished) {
    return (
      <>
        <CssBaseline />
        <LanguageManager />
        <RouterProvider router={router} />
      </>
    );
  }

  return <Loading />;
}

export default App;
