var __assign = this && this.__assign || function () {
  __assign = Object.assign || function (t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
      s = arguments[i];

      for (var p in s) {
        if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
    }

    return t;
  };

  return __assign.apply(this, arguments);
};

var __rest = this && this.__rest || function (s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};

import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import classNames from 'classnames';
import RcMenu, { SubMenu as RcSubMenu, MenuItemGroup, MenuItem as RcMenuItem, Divider as MenuDivider } from 'rc-menu';
import "./style/menu.css";
var prefixCls = 'dmc-menu';
export var Menu = function Menu(props) {
  var _a;

  var type = props.type,
      className = props.className,
      restProps = __rest(props, ["type", "className"]);

  var cls = classNames((_a = {}, _a[prefixCls + "-" + type] = type, _a), className);
  return _jsx(RcMenu, __assign({}, restProps, {
    className: cls,
    prefixCls: prefixCls
  }), void 0);
};
Menu.displayName = 'Menu';
export default Menu;
export var SubMenu = function SubMenu(props) {
  var _a, _b;

  var cls = classNames((_a = {}, _a[prefixCls + "-" + props.type] = props.type, _a), props.className);
  var popCls = classNames((_b = {}, _b[prefixCls + "-popup-" + props.type] = props.type, _b), props.popupClassName);
  return _jsx(RcSubMenu, __assign({}, props, {
    className: cls,
    popupClassName: popCls
  }), void 0);
};
export var MenuItem = function MenuItem(props) {
  var _a;

  var danger = props.danger,
      className = props.className,
      restProps = __rest(props, ["danger", "className"]);

  var cls = classNames(className, (_a = {}, _a[prefixCls + "-item-danger"] = danger, _a));
  return _jsx(RcMenuItem, __assign({}, restProps, {
    className: cls
  }), void 0);
};
SubMenu.displayName = 'SubMenu';
var SubMenuMemo = /*#__PURE__*/React.memo(SubMenu);
SubMenuMemo.displayName = 'SubMenuMemo';
var MenuMemo = /*#__PURE__*/React.memo(Menu);
MenuMemo.displayName = 'MenuMemo';
export { MenuItemGroup, MenuDivider, MenuMemo, SubMenuMemo };

