- Add adminStore with Zustand for authentication state persistence - Add adminApi service for all admin endpoints - Add Login page with error handling and redirect - Add AdminLayout with sidebar navigation and route protection - Add Dashboard with stats and quick actions - Add Questions page with full CRUD, filters, and AI generation modal - Add Calendar page for scheduling questions by date - Integrate admin routes in App.tsx with nested routing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { Routes, Route, Navigate } from 'react-router-dom'
|
|
import Home from './pages/Home'
|
|
import Lobby from './pages/Lobby'
|
|
import Game from './pages/Game'
|
|
import Results from './pages/Results'
|
|
import Replay from './pages/Replay'
|
|
import { AdminLayout, Login, Dashboard, Questions, Calendar } from './pages/admin'
|
|
|
|
function App() {
|
|
return (
|
|
<div className="min-h-screen">
|
|
<Routes>
|
|
{/* Game routes */}
|
|
<Route path="/" element={<Home />} />
|
|
<Route path="/lobby/:roomCode" element={<Lobby />} />
|
|
<Route path="/game/:roomCode" element={<Game />} />
|
|
<Route path="/results/:roomCode" element={<Results />} />
|
|
<Route path="/replay/:replayCode" element={<Replay />} />
|
|
|
|
{/* Admin routes */}
|
|
<Route path="/admin/login" element={<Login />} />
|
|
<Route path="/admin" element={<AdminLayout />}>
|
|
<Route index element={<Navigate to="dashboard" replace />} />
|
|
<Route path="dashboard" element={<Dashboard />} />
|
|
<Route path="questions" element={<Questions />} />
|
|
<Route path="calendar" element={<Calendar />} />
|
|
</Route>
|
|
</Routes>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default App
|