import { lazy, Suspense } from 'react'; import { Routes, Route, Navigate } from 'react-router-dom'; import SessionGate from './components/SessionGate'; import Layout from './components/Layout/Layout'; import { WebSocketProvider } from './context/WebSocketProvider'; const DashboardPage = lazy(() => import('./pages/DashboardPage')); const AgentsPage = lazy(() => import('./pages/AgentsPage')); const BuilderPage = lazy(() => import('./pages/BuilderPage')); const SettingsPage = lazy(() => import('./pages/SettingsPage')); const GuidePage = lazy(() => import('./pages/GuidePage')); function PageFallback() { return (

Loading…

); } function App() { return ( // WebSocketProvider mounts a single WS connection shared by all routes. // No page or component should call new WebSocket() directly — use useWebSocket(). }> } /> } /> } /> } /> } /> } /> } /> ); } export default App;