Files
jobtrackingapp/job-tracker-ui/src/accountPlan.tsx
T
cesnimda a25c31b93a
CI and Deploy / test (pull_request) Successful in 5m6s
CI and Deploy / deploy (pull_request) Has been skipped
feat(plans): publish honest Free and Pro
2026-08-15 18:04:18 +02:00

21 lines
788 B
TypeScript

import React, { createContext, useContext } from "react";
import type { PublicPlanId } from "./planCatalog";
export type AccountPlan = {
plan: PublicPlanId;
canUseAi: boolean;
canUseProThemes: boolean;
};
// Routed application screens always receive the server-backed value from App.
// The permissive default keeps isolated component previews usable; the API remains authoritative.
const AccountPlanContext = createContext<AccountPlan>({ plan: "pro", canUseAi: true, canUseProThemes: true });
export function AccountPlanProvider({ value, children }: { value: AccountPlan; children: React.ReactNode }) {
return <AccountPlanContext.Provider value={value}>{children}</AccountPlanContext.Provider>;
}
export function useAccountPlan() {
return useContext(AccountPlanContext);
}