import { useQuery } from "@tanstack/react-query";
import { getCampaignSDK } from "services";

export const useEmailCampaignStats = (campaignId: string) => {
  return useQuery({
    queryKey: ["emailCampaignStats", campaignId],
    queryFn: async () => {
      return getCampaignSDK().email.getCampaignAnalytics(campaignId);
    },
    enabled: Boolean(campaignId),
  });
};
