import { emptyObject } from "@contember/react-utils";
import { useMemo } from "react";
import { defaultLocale } from "./defaultLocale.js";
import { DictionaryResolver } from "./DictionaryResolver.js";
import { I18nContext } from "./I18nContext.js";
import { jsxDEV } from "react/jsx-dev-runtime";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/i18n/I18nProvider.tsx";
function I18nProvider({
  localeCode,
  dictionaries = emptyObject,
  children
}) {
  const locale = useMemo(() => ({
    code: localeCode || defaultLocale.code
  }), [localeCode]);
  const metadata = useMemo(() => ({
    locale,
    dictionaryResolver: new DictionaryResolver(dictionaries)
  }), [dictionaries, locale]);
  return /* @__PURE__ */ jsxDEV(I18nContext.Provider, {
    value: metadata,
    children
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 26,
    columnNumber: 9
  }, this);
}
export {
  I18nProvider
};
//# sourceMappingURL=I18nProvider.js.map
