Files
boc/packages/ui/src/App.tsx
T

97 lines
4.5 KiB
TypeScript
Raw Normal View History

import { Routes, Route, Link } from 'react-router-dom';
import { useState } from 'react';
import DatasetExplorer from './pages/DatasetExplorer';
import ArtifactViewer from './pages/ArtifactViewer';
import MissionUpload from './pages/MissionUpload';
2026-07-02 16:22:21 +00:00
import FieldConsole from './pages/FieldConsole';
import HealthDashboard from './pages/HealthDashboard';
import PilotChecklist from './pages/PilotChecklist';
import ReadinessDashboard from './pages/ReadinessDashboard';
2026-07-02 17:39:51 +00:00
import KillList from './pages/KillList';
function App() {
const [developerMode, setDeveloperMode] = useState(false);
2026-07-02 17:41:41 +00:00
const [menuOpen, setMenuOpen] = useState(false);
return (
2026-07-02 17:41:41 +00:00
<div style={{ fontFamily: 'system-ui, sans-serif', maxWidth: 1200, margin: '0 auto', padding: 12 }}>
<header style={{ borderBottom: '2px solid #333', paddingBottom: 12, marginBottom: 12 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<h1 style={{ fontSize: '1.3rem', margin: 0 }}>LandveX</h1>
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
<button
onClick={() => setDeveloperMode(!developerMode)}
2026-07-02 17:44:32 +00:00
style={{
padding: '8px 12px',
background: developerMode ? '#ffd700' : '#f0f0f0',
border: '1px solid #ccc',
borderRadius: 4,
cursor: 'pointer',
fontSize: '0.8rem',
minWidth: 44,
minHeight: 44,
}}
2026-07-02 17:41:41 +00:00
>
{developerMode ? '🔓' : '🔒'}
</button>
<button
onClick={() => setMenuOpen(!menuOpen)}
2026-07-02 17:44:32 +00:00
style={{
padding: '8px 12px',
background: '#f0f0f0',
border: '1px solid #ccc',
borderRadius: 4,
cursor: 'pointer',
fontSize: '1rem',
minWidth: 44,
minHeight: 44,
}}
2026-07-02 17:41:41 +00:00
>
{menuOpen ? '✕' : '☰'}
2026-07-02 17:41:41 +00:00
</button>
</div>
</div>
2026-07-02 17:41:41 +00:00
{menuOpen && (
2026-07-02 17:44:32 +00:00
<nav style={{
display: 'flex',
flexDirection: 'column',
gap: 12,
marginTop: 12,
fontSize: '1rem',
padding: '12px 0',
borderTop: '1px solid #eee',
}}>
<Link to="/" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>📊 Explorer</Link>
<Link to="/upload" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>📤 Upload</Link>
<Link to="/console" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>🎮 Console</Link>
<Link to="/health" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>🏥 Health</Link>
<Link to="/pilot" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}> Pilot</Link>
<Link to="/readiness" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>📋 Ready</Link>
<Link to="/kill" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#333' }}>🔥 Kill</Link>
2026-07-02 17:41:41 +00:00
{developerMode && (
<>
2026-07-02 17:44:32 +00:00
<Link to="/datasets" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#666' }}>🗂 Data</Link>
<Link to="/models" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#666' }}>🧠 Models</Link>
<Link to="/training" onClick={() => setMenuOpen(false)} style={{ padding: '8px 0', textDecoration: 'none', color: '#666' }}>🏋 Train</Link>
2026-07-02 17:41:41 +00:00
</>
)}
</nav>
)}
</header>
<Routes>
<Route path="/" element={<DatasetExplorer />} />
<Route path="/upload" element={<MissionUpload />} />
<Route path="/artifact/:id" element={<ArtifactViewer />} />
2026-07-02 16:22:21 +00:00
<Route path="/console" element={<FieldConsole />} />
<Route path="/health" element={<HealthDashboard />} />
<Route path="/pilot" element={<PilotChecklist />} />
<Route path="/readiness" element={<ReadinessDashboard />} />
2026-07-02 17:39:51 +00:00
<Route path="/kill" element={<KillList />} />
</Routes>
</div>
);
}
export default App;