"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const core_1 = require("@bluebase/core");
const components_1 = require("@bluebase/components");
const react_1 = tslib_1.__importDefault(require("react"));
class LocalePicker extends react_1.default.PureComponent {
    render() {
        const BB = this.context;
        const localeOptions = BB.Configs.getValue('locale.options');
        return (react_1.default.createElement(core_1.IntlContext.Consumer, null, ({ changeLocale }) => (react_1.default.createElement(components_1.Picker, { selectedValue: BB.Configs.getValue('locale'), style: { width: 150 }, onValueChange: changeLocale }, Object.keys(localeOptions).map(locale => (react_1.default.createElement(components_1.Picker.Item, { label: localeOptions[locale], value: locale, key: locale })))))));
    }
}
LocalePicker.contextType = core_1.BlueBaseContext;
exports.LocalePicker = LocalePicker;
