import { lazy, Suspense } from 'react'; import { Navigate, Route, Routes } from 'react-router-dom'; import { Layout } from './components/Layout'; import { ProtectedRoute } from './components/ProtectedRoute'; import { LoginPage } from './pages/LoginPage'; // Each page is its own file to download, fetched the first time it is opened, // so signing in does not wait on the encounter tracker or the character builder. const RegisterPage = lazy(() => import('./pages/RegisterPage').then((m) => ({ default: m.RegisterPage }))); const CampaignListPage = lazy(() => import('./pages/CampaignListPage').then((m) => ({ default: m.CampaignListPage }))); const CampaignHomePage = lazy(() => import('./pages/CampaignHomePage').then((m) => ({ default: m.CampaignHomePage }))); const PartyOverviewPage = lazy(() => import('./pages/PartyOverviewPage').then((m) => ({ default: m.PartyOverviewPage }))); const CharacterSheetPage = lazy(() => import('./pages/CharacterSheetPage').then((m) => ({ default: m.CharacterSheetPage }))); const CharacterBuilderPage = lazy(() => import('./pages/CharacterBuilderPage').then((m) => ({ default: m.CharacterBuilderPage }))); const EncounterPage = lazy(() => import('./pages/EncounterPage').then((m) => ({ default: m.EncounterPage }))); const AccountPage = lazy(() => import('./pages/AccountPage').then((m) => ({ default: m.AccountPage }))); function App() { return ( } /> } /> }> }> } /> } /> } /> } /> } /> } /> } /> } /> } /> ); } export default App;