"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigColumnPopup = exports.HIDE = exports.INSERT_RIGHT = exports.INSERT_LEFT = void 0;
var react_1 = __importDefault(require("react"));
var Popover_1 = __importDefault(require("@mui/material/Popover"));
var List_1 = __importDefault(require("@mui/material/List"));
var ListItem_1 = __importDefault(require("@mui/material/ListItem"));
var ListItemText_1 = __importDefault(require("@mui/material/ListItemText"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
exports.INSERT_LEFT = 'left';
exports.INSERT_RIGHT = 'right';
exports.HIDE = 'hide';
var ConfigColumnPopup = function (_a) {
    var _b;
    var open = _a.open, anchorEl = _a.anchorEl, onClick = _a.onClick, onClose = _a.onClose, actions = _a.actions;
    var TEXT = (_b = {},
        _b[exports.INSERT_LEFT] = ui_i18n_1.default.text('Insert 1 left'),
        _b[exports.INSERT_RIGHT] = ui_i18n_1.default.text('Insert 1 right'),
        _b[exports.HIDE] = ui_i18n_1.default.text('Hide column'),
        _b);
    var getClickHandler = function (action) { return function () {
        onClick(action);
    }; };
    return (react_1.default.createElement(Popover_1.default, { open: open, anchorEl: anchorEl, onClose: onClose },
        react_1.default.createElement(List_1.default, { component: "div" }, actions.map(function (action, index) { return (react_1.default.createElement(ListItem_1.default, { button: true, component: "div", key: index, onClick: getClickHandler(action) },
            react_1.default.createElement(ListItemText_1.default, { primary: TEXT[action], primaryTypographyProps: { variant: 'body2' } }))); }))));
};
exports.ConfigColumnPopup = ConfigColumnPopup;
