import React, { useContext } from "react";
import { I18nContext, I18nProvide } from "../I18n";
var I18nBoundary = function I18nBoundary(param) {
    var children = param.children;
    var outerI18n = useContext(I18nContext);
    var hasOuterI18nProvider = Boolean((outerI18n === null || outerI18n === void 0 ? void 0 : outerI18n.setLanguage) || (outerI18n === null || outerI18n === void 0 ? void 0 : outerI18n.setLocale));
    if (hasOuterI18nProvider) {
        return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
    }
    return /*#__PURE__*/ React.createElement(I18nProvide, null, children);
};
export default I18nBoundary;
