"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InitWarningDisplay = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var init_1 = require("../actions/init");
var i18n_1 = require("../api/i18n");
var core_1 = require("@blueprintjs/core");
var hooks_1 = require("./hooks");
var context_1 = require("../components/map-providers/context");
var InitWarningDisplay = function () {
    var dispatch = (0, context_1.useReduxDispatch)();
    var acknowledge = function () { return dispatch((0, init_1.acknowledgeInitWarnings)()); };
    var warnings = (0, hooks_1.useInitWarnings)();
    var locale = (0, hooks_1.useViewerLocale)();
    if (warnings && warnings.length && acknowledge) {
        return React.createElement(core_1.Dialog, { icon: "warning-sign", isOpen: true, usePortal: false, onClose: acknowledge, title: (0, i18n_1.tr)("WARNING", locale) },
            React.createElement("div", { className: "bp3-dialog-body" },
                React.createElement("p", null, (0, i18n_1.tr)("INIT_WARNINGS_FOUND", locale)),
                React.createElement("ul", null, warnings.map(function (w) { return React.createElement("li", { key: w }, w); }))),
            React.createElement("div", { className: "bp3-dialog-footer" },
                React.createElement("div", { className: "bp3-dialog-footer-actions" },
                    React.createElement(core_1.Button, { intent: core_1.Intent.PRIMARY, onClick: acknowledge, text: (0, i18n_1.tr)("OK", locale) }))));
    }
    else {
        return React.createElement("noscript", null);
    }
};
exports.InitWarningDisplay = InitWarningDisplay;
//# sourceMappingURL=init-warning-display.js.map