better-auth/apps/web/modules/saas/payments/lib/purchases-context.ts

17 lines
418 B
TypeScript
Raw Normal View History

2025-10-29 13:43:43 +05:00
import type { PlanId } from "@saas/payments/types";
import React from "react";
export const PurchasesContext = React.createContext<
| {
activeSubscription: {
id: string;
purchaseId?: string;
} | null;
loaded: boolean;
hasSubscription: (planIds?: PlanId[] | PlanId) => boolean;
refetchPurchases: () => Promise<void>;
hasPurchase: (planId: PlanId) => boolean;
}
| undefined
>(undefined);