import { useQuery, useMutation } from "@tanstack/react-query";
import {
  getSupportPlans,
  buySupportPlan,
  getUserSupportPlan,
  upgradeSupportPlan,
} from "../service/SupportService";

export const useGetSupportPlans = () => {
  return useQuery({ queryKey: ["support-plans"], queryFn: getSupportPlans });
};

export const useBuySupportPlan = () => {
  return useMutation({
    mutationFn: (planId: string) => buySupportPlan(planId),
  });
};

export const useGetUserSupportPlan = () => {
  return useQuery({
    queryKey: ["user-support-plan"],
    queryFn: getUserSupportPlan,
  });
};

export const useUpgradeSupportPlan = () => {
  return useMutation({
    mutationFn: (id: string) => upgradeSupportPlan(id),
  });
};
