import { useMutation, useQuery } from "@tanstack/react-query";
import * as api from "../service/ResellerService";

export const useGetResellers = () => {
  return useQuery({
    queryKey: ["resellers"],
    queryFn: api.getResellers,
  });
};

export const useCreateResellers = () => {
  return useMutation({
    mutationFn: api.createReseller,
  });
};

export const useGetWithdraws = (page: number) => {
  return useQuery({
    queryKey: ["withdraw", page],
    queryFn: () => api.getWithDraws(page),
  });
};

export const usePayment = () => {
  return useMutation({
    mutationFn: api.payment,
  });
};
