import React from 'react'
import { Routes, Route } from 'react-router-dom'
import { RoboticsLayout } from './components/layout/robotics-layout'
import HomePage from './app/page'
// Load actual page components
const RobotControlPage = React.lazy(() => import('./app/robot-control/page'))
const YahboomControlPage = React.lazy(() => import('./app/robot-control/yahboom/page'))
const FlyingCleaningControlPage = React.lazy(() => import('./app/robot-control/flying-cleaning/page'))
const HueControlPage = React.lazy(() => import('./app/robot-control/hue/page'))
const GazeboControlPage = React.lazy(() => import('./app/robot-control/gazebo/page'))
const EnvironmentsPage = React.lazy(() => import('./app/environments/page'))
const SensorsPage = React.lazy(() => import('./app/sensors/page'))
const VRControlPage = React.lazy(() => import('./app/vbot-control/page'))
const VRoidPage = React.lazy(() => import('./app/vroid/page'))
const VRMAvatarsPage = React.lazy(() => import('./app/vrm-avatars/page'))
const Unity3DPage = React.lazy(() => import('./app/unity3d/page'))
const ResonitePage = React.lazy(() => import('./app/resonite/page'))
const VRChatPage = React.lazy(() => import('./app/vrchat/page'))
const MapPage = React.lazy(() => import('./app/map/page'))
const NianticSplatsPage = React.lazy(() => import('./app/niantic-splats/page'))
const DocsPage = React.lazy(() => import('./app/docs/page'))
const SetupPrerequisitesPage = React.lazy(() => import('./app/docs/setup-prerequisites/page'))
const RobotsPage = React.lazy(() => import('./app/docs/robots/page'))
const ArchitecturePage = React.lazy(() => import('./app/docs/architecture/page'))
const ROSFundamentalsPage = React.lazy(() => import('./app/docs/ros-fundamentals/page'))
const ROSIntegrationPage = React.lazy(() => import('./app/docs/ros-integration/page'))
const MCPServerPage = React.lazy(() => import('./app/docs/mcp-server/page'))
const WorldLabsPage = React.lazy(() => import('./app/docs/world-labs/page'))
const VRPlatformsPage = React.lazy(() => import('./app/docs/vr-platforms/page'))
const DevelopmentPage = React.lazy(() => import('./app/docs/development/page'))
const WatchfilesPage = React.lazy(() => import('./app/docs/development/watchfiles/page'))
const DocsYahboomPage = React.lazy(() => import('./app/docs/robots/yahboom-rosmaster/page'))
const DocsDreamePage = React.lazy(() => import('./app/docs/robots/dreame-d20-pro/page'))
const DocsTdronePage = React.lazy(() => import('./app/docs/robots/tdrone-mini/page'))
const DocsVbotScoutPage = React.lazy(() => import('./app/docs/vbot-scout/page'))
const DocsHardwarePage = React.lazy(() => import('./app/docs/hardware/page'))
const DocsTurbopackPage = React.lazy(() => import('./app/docs/turbopack/page'))
const DocsLLMPage = React.lazy(() => import('./app/docs/llm-integration/page'))
const DocsVRMPage = React.lazy(() => import('./app/docs/vrm-avatars/page'))
const DocsNianticPage = React.lazy(() => import('./app/docs/niantic-splats/page'))
const AILLMPage = React.lazy(() => import('./app/ai-llm/page'))
const SettingsPage = React.lazy(() => import('./app/settings/page'))
const WorkflowsPage = React.lazy(() => import('./app/workflows/page'))
const NewWorkflowPage = React.lazy(() => import('./app/workflows/new/page'))
const EditWorkflowPage = React.lazy(() => import('./app/workflows/edit/page'))
const ExecuteWorkflowPage = React.lazy(() => import('./app/workflows/execute/page'))
const OnboardingPage = React.lazy(() => import('./app/onboarding/page'))
function App() {
return (
<React.Suspense fallback={
<div style={{
padding: '20px',
backgroundColor: '#f8f9fa',
minHeight: '100vh',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}>
<div style={{ textAlign: 'center' }}>
<div style={{
width: '40px',
height: '40px',
border: '4px solid #f3f3f3',
borderTop: '4px solid #2563eb',
borderRadius: '50%',
animation: 'spin 1s linear infinite',
margin: '0 auto 20px'
}}></div>
<p style={{ color: '#666' }}>Loading your robotics dashboard...</p>
</div>
<style>{`
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`}</style>
</div>
}>
<Routes>
<Route path="/" element={<RoboticsLayout><HomePage /></RoboticsLayout>} />
<Route path="/robot-control" element={<RoboticsLayout><RobotControlPage /></RoboticsLayout>} />
<Route path="/robot-control/yahboom" element={<RoboticsLayout><YahboomControlPage /></RoboticsLayout>} />
<Route path="/robot-control/flying-cleaning" element={<RoboticsLayout><FlyingCleaningControlPage /></RoboticsLayout>} />
<Route path="/robot-control/hue" element={<RoboticsLayout><HueControlPage /></RoboticsLayout>} />
<Route path="/robot-control/gazebo" element={<RoboticsLayout><GazeboControlPage /></RoboticsLayout>} />
<Route path="/map" element={<RoboticsLayout><MapPage /></RoboticsLayout>} />
<Route path="/environments" element={<RoboticsLayout><EnvironmentsPage /></RoboticsLayout>} />
<Route path="/sensors" element={<RoboticsLayout><SensorsPage /></RoboticsLayout>} />
<Route path="/vbot-control" element={<RoboticsLayout><VRControlPage /></RoboticsLayout>} />
<Route path="/vr-control" element={<RoboticsLayout><VRControlPage /></RoboticsLayout>} />
<Route path="/vroid" element={<RoboticsLayout><VRoidPage /></RoboticsLayout>} />
<Route path="/unity3d" element={<RoboticsLayout><Unity3DPage /></RoboticsLayout>} />
<Route path="/resonite" element={<RoboticsLayout><ResonitePage /></RoboticsLayout>} />
<Route path="/vrchat" element={<RoboticsLayout><VRChatPage /></RoboticsLayout>} />
<Route path="/docs" element={<RoboticsLayout><DocsPage /></RoboticsLayout>} />
<Route path="/docs/setup-prerequisites" element={<RoboticsLayout><SetupPrerequisitesPage /></RoboticsLayout>} />
<Route path="/docs/robots" element={<RoboticsLayout><RobotsPage /></RoboticsLayout>} />
<Route path="/docs/architecture" element={<RoboticsLayout><ArchitecturePage /></RoboticsLayout>} />
<Route path="/docs/ros-fundamentals" element={<RoboticsLayout><ROSFundamentalsPage /></RoboticsLayout>} />
<Route path="/docs/ros-integration" element={<RoboticsLayout><ROSIntegrationPage /></RoboticsLayout>} />
<Route path="/docs/mcp-server" element={<RoboticsLayout><MCPServerPage /></RoboticsLayout>} />
<Route path="/docs/world-labs" element={<RoboticsLayout><WorldLabsPage /></RoboticsLayout>} />
<Route path="/docs/vr-platforms" element={<RoboticsLayout><VRPlatformsPage /></RoboticsLayout>} />
<Route path="/docs/development" element={<RoboticsLayout><DevelopmentPage /></RoboticsLayout>} />
<Route path="/docs/development/watchfiles" element={<RoboticsLayout><WatchfilesPage /></RoboticsLayout>} />
<Route path="/docs/robots/yahboom-rosmaster" element={<RoboticsLayout><DocsYahboomPage /></RoboticsLayout>} />
<Route path="/docs/robots/dreame-d20-pro" element={<RoboticsLayout><DocsDreamePage /></RoboticsLayout>} />
<Route path="/docs/robots/tdrone-mini" element={<RoboticsLayout><DocsTdronePage /></RoboticsLayout>} />
<Route path="/docs/vbot-scout" element={<RoboticsLayout><DocsVbotScoutPage /></RoboticsLayout>} />
<Route path="/docs/hardware" element={<RoboticsLayout><DocsHardwarePage /></RoboticsLayout>} />
<Route path="/docs/turbopack" element={<RoboticsLayout><DocsTurbopackPage /></RoboticsLayout>} />
<Route path="/docs/llm-integration" element={<RoboticsLayout><DocsLLMPage /></RoboticsLayout>} />
<Route path="/docs/vrm-avatars" element={<RoboticsLayout><DocsVRMPage /></RoboticsLayout>} />
<Route path="/docs/niantic-splats" element={<RoboticsLayout><DocsNianticPage /></RoboticsLayout>} />
<Route path="/docs/ai-ml" element={<RoboticsLayout><AILLMPage /></RoboticsLayout>} />
<Route path="/docs/security" element={<RoboticsLayout><DocsPage /></RoboticsLayout>} />
<Route path="/ai-llm" element={<RoboticsLayout><AILLMPage /></RoboticsLayout>} />
<Route path="/settings" element={<RoboticsLayout><SettingsPage /></RoboticsLayout>} />
<Route path="/onboarding" element={<RoboticsLayout><OnboardingPage /></RoboticsLayout>} />
<Route path="/workflows" element={<RoboticsLayout><WorkflowsPage /></RoboticsLayout>} />
<Route path="/workflows/new" element={<RoboticsLayout><NewWorkflowPage /></RoboticsLayout>} />
<Route path="/workflows/edit/:id" element={<RoboticsLayout><EditWorkflowPage /></RoboticsLayout>} />
<Route path="/workflows/:id/execute" element={<RoboticsLayout><ExecuteWorkflowPage /></RoboticsLayout>} />
<Route path="/llm-management" element={<RoboticsLayout><AILLMPage /></RoboticsLayout>} />
<Route path="/monitoring" element={<RoboticsLayout><SensorsPage /></RoboticsLayout>} />
<Route path="/niantic-splats" element={<RoboticsLayout><NianticSplatsPage /></RoboticsLayout>} />
<Route path="/vrm-avatars" element={<RoboticsLayout><VRMAvatarsPage /></RoboticsLayout>} />
<Route path="*" element={<RoboticsLayout><div style={{ padding: '20px', backgroundColor: '#f8f9fa', minHeight: '100vh' }}><h1 style={{ color: '#dc2626', fontSize: '24px', marginBottom: '20px' }}>404 - Page Not Found</h1><p style={{ color: '#666' }}>The page you're looking for doesn't exist yet.</p></div></RoboticsLayout>} />
</Routes>
</React.Suspense>
)
}
export default App