"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HistoryMenuButton = void 0;
var react_1 = __importDefault(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var MoreVert_1 = __importDefault(require("@mui/icons-material/MoreVert"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var SmallIconButton_1 = require("../../../SmallIconButton");
var DropDownMenuButton_1 = require("../../../DropDownMenuButton");
var MenuItemRenderer_1 = require("./components/MenuItemRenderer");
var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
var HistoryMenuButton = function () {
    var setHistoryMode = (0, MdmModuleContext_1.useMdmAction)('setHistoryMode');
    var mode = (0, MdmModuleContext_1.useMdmHistoryMode)();
    var menuItems = [
        {
            text: ui_i18n_1.default.text('Compare to Current view'),
            selected: mode === mdm_sdk_1.HistoryMode.Current,
            onClick: function () { return setHistoryMode(mdm_sdk_1.HistoryMode.Current); }
        },
        {
            text: ui_i18n_1.default.text('Compare to Previous view'),
            selected: mode === mdm_sdk_1.HistoryMode.Previous,
            onClick: function () { return setHistoryMode(mdm_sdk_1.HistoryMode.Previous); }
        }
    ];
    return (react_1.default.createElement(DropDownMenuButton_1.DropDownMenuButton, { MenuItemRenderer: MenuItemRenderer_1.MenuItemRenderer, buttonComponent: SmallIconButton_1.SmallIconButton, buttonProps: {
            icon: MoreVert_1.default,
            size: 'L'
        }, menuId: 'history-menu', menuItems: menuItems }));
};
exports.HistoryMenuButton = HistoryMenuButton;
