"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComponentContextProvider = exports.LocalizeContextProvider = exports.LocalizeContext = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const icon_1 = require("./icon");
const warning_1 = require("./utils/warning");
const emptyLocalize = (v) => {
    (0, warning_1.warning)(false, 'Using the default localize fn');
    return '';
};
exports.LocalizeContext = react_1.default.createContext({
    localize: emptyLocalize,
});
exports.LocalizeContext.displayName = 'LocalizeContext';
function LocalizeContextProvider(props) {
    return (react_1.default.createElement(exports.LocalizeContext.Provider, { value: props.value },
        react_1.default.createElement(exports.LocalizeContext.Consumer, null, (value) => (props.value === value ? props.children : null))));
}
exports.LocalizeContextProvider = LocalizeContextProvider;
function ComponentContextProvider(props) {
    return (react_1.default.createElement(icon_1.IconContextProvider, { value: props.value },
        react_1.default.createElement(LocalizeContextProvider, { value: { localize: props.value.localize } }, props.children)));
}
exports.ComponentContextProvider = ComponentContextProvider;
//# sourceMappingURL=locale-context-provider.js.map