feat/Update_Controllers_to_Allow_for_Premium_Membership

This commit is contained in:
cesnimda
2026-08-03 09:17:28 +02:00
parent de937d25dc
commit c3f4a57195
187 changed files with 26062 additions and 991 deletions
+19
View File
@@ -0,0 +1,19 @@
import React, { createContext, useContext } from "react";
export type AccountPlan = {
plan: "free" | "pro";
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);
}