Add stats screen with backend endpoint and frontend page
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>
This commit is contained in:
9
frontend/src/hooks/useStats.ts
Normal file
9
frontend/src/hooks/useStats.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { getStats } from '../api/stats'
|
||||
|
||||
export function useStats() {
|
||||
return useQuery({
|
||||
queryKey: ['stats'],
|
||||
queryFn: getStats,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user