import React from 'react';
import Popover from '@mui/material/Popover';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import i18n from 'ui-i18n';
export var INSERT_LEFT = 'left';
export var INSERT_RIGHT = 'right';
export var HIDE = 'hide';
export 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[INSERT_LEFT] = i18n.text('Insert 1 left'),
        _b[INSERT_RIGHT] = i18n.text('Insert 1 right'),
        _b[HIDE] = i18n.text('Hide column'),
        _b);
    var getClickHandler = function (action) { return function () {
        onClick(action);
    }; };
    return (React.createElement(Popover, { open: open, anchorEl: anchorEl, onClose: onClose },
        React.createElement(List, { component: "div" }, actions.map(function (action, index) { return (React.createElement(ListItem, { button: true, component: "div", key: index, onClick: getClickHandler(action) },
            React.createElement(ListItemText, { primary: TEXT[action], primaryTypographyProps: { variant: 'body2' } }))); }))));
};
