Add genlocke cumulative graveyard with backend endpoint and UI

Aggregates all fainted encounters across every leg of a genlocke into a
unified graveyard view. Backend serves GET /genlockes/{id}/graveyard with
per-entry leg/game context and summary stats (total deaths, deaths per
leg, deadliest leg). Frontend adds a toggle button on the genlocke detail
page that reveals a filterable/sortable grid of grayscale Pokemon cards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-09 11:00:37 +01:00
parent d39898a7a1
commit 3bd4250305
9 changed files with 382 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import { advanceLeg, createGenlocke, getGamesByRegion, getGenlockes, getGenlocke } from '../api/genlockes'
import { advanceLeg, createGenlocke, getGamesByRegion, getGenlockes, getGenlocke, getGenlockeGraveyard } from '../api/genlockes'
import type { CreateGenlockeInput } from '../types/game'
export function useGenlockes() {
@@ -16,6 +16,13 @@ export function useGenlocke(id: number) {
})
}
export function useGenlockeGraveyard(id: number) {
return useQuery({
queryKey: ['genlockes', id, 'graveyard'],
queryFn: () => getGenlockeGraveyard(id),
})
}
export function useRegions() {
return useQuery({
queryKey: ['games', 'by-region'],