import { createContext } from 'react'; import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; import { Locale } from '../locale-provider'; export interface CSPConfig { nonce?: string; } export interface ConfigConsumerProps { getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; rootPrefixCls?: string; getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => string; renderEmpty: RenderEmptyHandler; csp?: CSPConfig; autoInsertSpaceInButton?: boolean; locale?: Locale; pageHeader?: { ghost: boolean; }; } export const ConfigContext = createContext({ // We provide a default function for Context without provider getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => { if (customizePrefixCls) return customizePrefixCls; return `ant-${suffixCls}`; }, renderEmpty: defaultRenderEmpty, }); export const ConfigConsumer = ConfigContext.Consumer;