import React, { createContext, useContext, useState, ReactNode } from 'react'; type Tier = 'free' | 'pro'; interface SubscriptionContextType { tier: Tier; setTier: (tier: Tier) => void; isPro: boolean; } const SubscriptionContext = createContext(undefined); export function SubscriptionProvider({ children }: { children: ReactNode }) { // Hardcoded to 'free' by default for testing. In production, this would come from auth/backend. const [tier, setTier] = useState('free'); return ( {children} ); } export function useSubscription() { const context = useContext(SubscriptionContext); if (context === undefined) { throw new Error('useSubscription must be used within a SubscriptionProvider'); } return context; }