Skip to content

The open alternative to Salesforce, designed for AI.

522 B
Raw Blame
import { usePlanByPriceId } from '@/settings/billing/hooks/usePlanByPriceId';
import { useSplitPhaseItemsInPrices } from '@/settings/billing/hooks/useSplitPhaseItemsInPrices';

export const useNextPlan = () => {
  const { splitedPhaseItemsInPrices } = useSplitPhaseItemsInPrices();
  const { getPlanByPriceId } = usePlanByPriceId();

  const nextPlan = splitedPhaseItemsInPrices.nextBasePrice
    ? getPlanByPriceId(splitedPhaseItemsInPrices.nextBasePrice.stripePriceId)
    : undefined;

  return {
    nextPlan,
  };
};