Add user authentication with login/signup/protected routes, boss pokemon detail fields and result team tracking, moves and abilities selector components and API, run ownership and visibility controls, and various UI improvements across encounters, run list, and journal pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
21 lines
603 B
TypeScript
21 lines
603 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { searchMoves, searchAbilities } from '../api/moves'
|
|
|
|
export function useSearchMoves(search: string, limit = 20) {
|
|
return useQuery({
|
|
queryKey: ['moves', 'search', search, limit],
|
|
queryFn: () => searchMoves(search, limit),
|
|
enabled: search.length > 0,
|
|
staleTime: 60_000,
|
|
})
|
|
}
|
|
|
|
export function useSearchAbilities(search: string, limit = 20) {
|
|
return useQuery({
|
|
queryKey: ['abilities', 'search', search, limit],
|
|
queryFn: () => searchAbilities(search, limit),
|
|
enabled: search.length > 0,
|
|
staleTime: 60_000,
|
|
})
|
|
}
|