// screenMATCH React Query hooks over the tool's namespace client. Keys are prefixed with the tool name // so the three tools never collide in the shared query cache. import { useMutation, useQuery } from '@tanstack/react-query' import { screenApi } from './api' export function useScreenRequirements() { return useQuery({ queryKey: ['screenmatch', 'requirements'], queryFn: screenApi.requirements }) } export function useScreenRequirement(id: string | null) { return useQuery({ queryKey: ['screenmatch', 'requirement', id], queryFn: () => screenApi.requirement(id as string), enabled: !!id, }) } export function useScreenCandidate(id: string | null) { return useQuery({ queryKey: ['screenmatch', 'candidate', id], queryFn: () => screenApi.candidate(id as string), enabled: !!id, }) } export function useScreenRanked(requirementId: string | null) { return useQuery({ queryKey: ['screenmatch', 'ranked', requirementId], queryFn: () => screenApi.rankCandidates(requirementId as string), enabled: !!requirementId, }) } export function useScreenOpportunities(candidateId: string | null) { return useQuery({ queryKey: ['screenmatch', 'opportunities', candidateId], queryFn: () => screenApi.opportunities(candidateId as string), enabled: !!candidateId, }) } export function useScreenScreen() { return useMutation({ mutationFn: (v: { candidateId: string; requirementId: string }) => screenApi.screen(v.candidateId, v.requirementId), }) }