Add filter controls to admin tables

Pokemon (type), Evolutions (trigger), Games (region/generation),
and Runs (status/game) now have dropdown filters alongside search.
Server-side filtering for paginated tables, client-side for small datasets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 20:29:55 +01:00
parent 5d444f0c91
commit c6521dd206
9 changed files with 188 additions and 20 deletions

View File

@@ -21,10 +21,10 @@ import type {
// --- Queries ---
export function usePokemonList(search?: string, limit = 50, offset = 0) {
export function usePokemonList(search?: string, limit = 50, offset = 0, type?: string) {
return useQuery({
queryKey: ['pokemon', { search, limit, offset }],
queryFn: () => adminApi.listPokemon(search, limit, offset),
queryKey: ['pokemon', { search, limit, offset, type }],
queryFn: () => adminApi.listPokemon(search, limit, offset, type),
})
}
@@ -213,10 +213,10 @@ export function useBulkImportBosses(gameId: number) {
// --- Evolution Queries & Mutations ---
export function useEvolutionList(search?: string, limit = 50, offset = 0) {
export function useEvolutionList(search?: string, limit = 50, offset = 0, trigger?: string) {
return useQuery({
queryKey: ['evolutions', { search, limit, offset }],
queryFn: () => adminApi.listEvolutions(search, limit, offset),
queryKey: ['evolutions', { search, limit, offset, trigger }],
queryFn: () => adminApi.listEvolutions(search, limit, offset, trigger),
})
}