'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext } from 'react';
const defaultFlags = {
    envDeploy: true,
    debug: false,
    reactFileManager: false,
    projects: false,
    codeReview: false,
    collaboration: false,
    bedrockIntegration: true,
};
const FeatureFlagsContext = createContext(defaultFlags);
/**
 * Provides server-resolved feature flags to all client components.
 * Initialized in the root layout with values from the DB singleton,
 * avoiding client-side fallback to environment variables.
 */
export function FeatureFlagsProvider({ children, flags }) {
    return _jsx(FeatureFlagsContext.Provider, { value: flags, children: children });
}
/**
 * Read feature flags from context. Returns all-flags-off defaults
 * when used outside a FeatureFlagsProvider (e.g., Storybook, tests).
 */
export function useFeatureFlags() {
    return useContext(FeatureFlagsContext);
}
