import { usePocketBase } from './usePocketBase';
import { useQuery } from '@tanstack/react-query';

const useListMatchingFrenzyCategories = () => {
  const { user, pb } = usePocketBase();

  return useQuery({
    queryKey: ['useListMatchingFrenzyCategories'],
    staleTime: 60 * 1000,
    queryFn: async () => {
      return await pb.collection('QuizMFCategories').getList<MatchingFrenzyCategory>(1, 9999, {
        $autoCancel: false,
      });
    },
    // enabled: !!user?.id,
  });
};

export default useListMatchingFrenzyCategories;
