mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-16 01:46:38 +00:00
20 lines
743 B
TypeScript
20 lines
743 B
TypeScript
import { GetOrgSubscriptionResponse } from "@server/routers/billing/types";
|
|
import { Tier } from "@server/types/Tiers";
|
|
import { createContext } from "react";
|
|
|
|
type SubscriptionStatusContextType = {
|
|
subscriptionStatus: GetOrgSubscriptionResponse | null;
|
|
updateSubscriptionStatus: (updatedSite: GetOrgSubscriptionResponse) => void;
|
|
getTier: () => { tier: Tier | null; active: boolean };
|
|
isSubscribed: () => boolean;
|
|
subscribed: boolean;
|
|
/** True when org has exceeded plan limits (sites, users, etc.). Only set when build === saas. */
|
|
limitsExceeded: boolean;
|
|
};
|
|
|
|
const SubscriptionStatusContext = createContext<
|
|
SubscriptionStatusContextType | undefined
|
|
>(undefined);
|
|
|
|
export default SubscriptionStatusContext;
|