Implements a dedicated /stats page showing cross-run aggregate statistics: run overview with win rate, runs by game bar chart, encounter breakdowns, top caught/encountered pokemon rankings, mortality analysis with death causes, and type distribution. Backend endpoint uses aggregate SQL queries to avoid N+1 fetching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { Routes, Route, Navigate } from 'react-router-dom'
|
|
import { Layout } from './components'
|
|
import { AdminLayout } from './components/admin'
|
|
import { Home, NewRun, RunList, RunEncounters, Stats } from './pages'
|
|
import {
|
|
AdminGames,
|
|
AdminGameDetail,
|
|
AdminPokemon,
|
|
AdminRouteDetail,
|
|
AdminEvolutions,
|
|
} from './pages/admin'
|
|
|
|
function App() {
|
|
return (
|
|
<Routes>
|
|
<Route path="/" element={<Layout />}>
|
|
<Route index element={<Home />} />
|
|
<Route path="runs" element={<RunList />} />
|
|
<Route path="runs/new" element={<NewRun />} />
|
|
<Route path="runs/:runId" element={<RunEncounters />} />
|
|
<Route path="stats" element={<Stats />} />
|
|
<Route path="runs/:runId/encounters" element={<Navigate to=".." relative="path" replace />} />
|
|
<Route path="admin" element={<AdminLayout />}>
|
|
<Route index element={<Navigate to="/admin/games" replace />} />
|
|
<Route path="games" element={<AdminGames />} />
|
|
<Route path="games/:gameId" element={<AdminGameDetail />} />
|
|
<Route path="games/:gameId/routes/:routeId" element={<AdminRouteDetail />} />
|
|
<Route path="pokemon" element={<AdminPokemon />} />
|
|
<Route path="evolutions" element={<AdminEvolutions />} />
|
|
</Route>
|
|
</Route>
|
|
</Routes>
|
|
)
|
|
}
|
|
|
|
export default App
|