import { __assign, __extends } from "tslib";
import { cloneElement, PureComponent } from 'react';
import { getKeyFromChildrenIndex } from './utils';
var CommonMenu = (function (_super) {
    __extends(CommonMenu, _super);
    function CommonMenu() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    CommonMenu.prototype.renderCommonMenuItem = function (component, index, subPrefix, extraProps) {
        var newChildProps = __assign({ specKey: getKeyFromChildrenIndex(component, index, subPrefix), onClick: this.handleClick }, extraProps);
        return cloneElement(component, newChildProps);
    };
    return CommonMenu;
}(PureComponent));
export default CommonMenu;
