UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 1.28 kB
{"version":3,"file":"context.mjs","names":["ConfigProvider"],"sources":["../../src/i18n/context.tsx"],"sourcesContent":["import { type ReactNode, memo } from 'react';\n\nimport ConfigProvider from '@/ConfigProvider';\nimport { type MotionComponentType } from '@/MotionProvider';\n\nimport type { TranslationResourcesInput } from './types';\n\nexport interface I18nProviderProps {\n children: ReactNode;\n locale?: string;\n motion: MotionComponentType;\n resources?: TranslationResourcesInput;\n}\n\n// Re-export for backward compatibility\nexport { I18nContext } from '@/ConfigProvider';\n\n// I18nProvider delegates to ConfigProvider with flattened i18n props\nexport const I18nProvider = memo<I18nProviderProps>(({ children, locale, resources, motion }) => {\n return (\n <ConfigProvider config={{}} locale={locale} motion={motion} resources={resources}>\n {children}\n </ConfigProvider>\n );\n});\n\n// Internal useI18n - for useTranslation only, not exported publicly\nexport { useI18n } from '@/ConfigProvider';\n\n// Re-export types\nexport type { I18nContextValue, TranslationKey, TranslationResources } from './types';\n"],"mappings":";;;;;AAkBA,MAAa,eAAe,MAAyB,EAAE,UAAU,QAAQ,WAAW,aAAa;AAC/F,QACE,oBAACA;EAAe,QAAQ,EAAE;EAAU;EAAgB;EAAmB;EACpE;GACc;EAEnB"}