import React from 'react';
import i18n from 'ui-i18n';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import { HistoryMode } from '@reltio/mdm-sdk';
import { SmallIconButton } from '../../../SmallIconButton';
import { DropDownMenuButton } from '../../../DropDownMenuButton';
import { MenuItemRenderer } from './components/MenuItemRenderer';
import { useMdmAction, useMdmHistoryMode } from '../../../contexts/MdmModuleContext';
export var HistoryMenuButton = function () {
    var setHistoryMode = useMdmAction('setHistoryMode');
    var mode = useMdmHistoryMode();
    var menuItems = [
        {
            text: i18n.text('Compare to Current view'),
            selected: mode === HistoryMode.Current,
            onClick: function () { return setHistoryMode(HistoryMode.Current); }
        },
        {
            text: i18n.text('Compare to Previous view'),
            selected: mode === HistoryMode.Previous,
            onClick: function () { return setHistoryMode(HistoryMode.Previous); }
        }
    ];
    return (React.createElement(DropDownMenuButton, { MenuItemRenderer: MenuItemRenderer, buttonComponent: SmallIconButton, buttonProps: {
            icon: MoreVertIcon,
            size: 'L'
        }, menuId: 'history-menu', menuItems: menuItems }));
};
