'use client';
import { jsx as _jsx } from "react/jsx-runtime";
/**
 * React Context for client-side logger injection
 * Allows consuming apps to provide their own logger instance
 */
import { createContext, useContext } from 'react';
import { noop_logger } from './types.js';
/**
 * Context for providing logger to client components
 */
const LoggerContext = createContext(noop_logger);
/**
 * Provider component for injecting logger into client components
 * Wrap your app or component tree with this provider to enable logging
 *
 * @example
 * ```tsx
 * import { createClientLogger } from 'hazo_logs/ui';
 * import { LoggerProvider } from 'hazo_collab_forms';
 *
 * const logger = createClientLogger({ packageName: 'my_app' });
 *
 * <LoggerProvider logger={logger}>
 *   <MyApp />
 * </LoggerProvider>
 * ```
 */
export function LoggerProvider({ logger, children }) {
    return (_jsx(LoggerContext.Provider, { value: logger || noop_logger, children: children }));
}
/**
 * Hook to access the logger from context
 * Returns no-op logger if no provider is found
 *
 * @example
 * ```tsx
 * const logger = use_logger();
 * logger.debug('Component mounted', { field_id: 'my_field' });
 * ```
 */
export function use_logger() {
    return useContext(LoggerContext);
}
//# sourceMappingURL=context.js.map