Add non-evolution form change support (Rotom, Oricorio, etc.)

Add a "Change Form" button in StatusChangeModal for Pokemon with
alternate forms sharing the same national_dex number. Mirrors the
existing evolution UI pattern, reusing currentPokemonId to track
the active form.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 12:55:11 +01:00
parent 2d4aa9d562
commit 069093ebae
5 changed files with 104 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import {
updateEncounter,
deleteEncounter,
fetchEvolutions,
fetchForms,
} from '../api/encounters'
import type { CreateEncounterInput, UpdateEncounterInput } from '../types/game'
@@ -50,3 +51,11 @@ export function useEvolutions(pokemonId: number | null, region?: string) {
enabled: pokemonId !== null,
})
}
export function useForms(pokemonId: number | null) {
return useQuery({
queryKey: ['forms', pokemonId],
queryFn: () => fetchForms(pokemonId!),
enabled: pokemonId !== null,
})
}