import _Menu from "@alifd/next/es/menu";
import React from "react";
var ContextMenu = function ContextMenu(props) {
  var position = props.position,
    onSelect = props.onSelect,
    items = props.items,
    open = props.open;
  return /*#__PURE__*/React.createElement("div", {
    style: {
      display: open ? "block" : "none",
      position: "absolute",
      top: position === null || position === void 0 ? void 0 : position.top,
      left: position === null || position === void 0 ? void 0 : position.left
    }
  }, /*#__PURE__*/React.createElement(_Menu, null, items.map(function (item) {
    return /*#__PURE__*/React.createElement(_Menu.Item, {
      onClick: function onClick() {
        onSelect(item.key);
      },
      key: item.key
    }, item.label);
  })));
};
export default ContextMenu;