import React, { useState, useEffect, Suspense, lazy } from 'react'; import { HashRouter as Router, Route, Switch } from 'react-router-dom'; import 'bootstrap/dist/css/bootstrap.min.css'; import './fonts/stylesheet.css'; const AuthPage = lazy(() => import('./pages/AuthPage')); const HomePage = lazy(() => import('./pages/HomePage')); const CandidatePage = lazy(() => import('./pages/CandidatePage')); const App = () => { const [isAuth, setIsAuth] = useState(false); useEffect(() => { const auth = localStorage.getItem('auth'); if (auth === 'true') { setIsAuth(true); } }, []); return ( Loading...}> {isAuth ? (
Not found page
) : ( )}
); }; export default App;