import { useQuery } from '@tanstack/react-query';
import { fetchCodeEntities } from '@/api/code';

export function useCodeEntities(q?: string, limit?: number) {
  return useQuery({
    queryKey: ['code', 'entities', { q, limit }],
    queryFn: () => fetchCodeEntities(q, limit),
  });
}
