'use client'; import { createContext, useContext } from 'react'; import type { FeatureFlags } from '../config/features'; const FeatureContext = createContext(undefined); interface FeatureProviderProps { features: FeatureFlags; children: React.ReactNode; } export function FeatureProvider({ features, children }: FeatureProviderProps) { return ( {children} ); } export function useFeature(key: K): FeatureFlags[K] { const context = useContext(FeatureContext); if (context === undefined) { throw new Error('useFeature must be used within a FeatureProvider'); } return context[key]; }