"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkGIOWIKTQjs = require('./chunk-GIOWIKTQ.js');

// tmp-babel/__shared__/web/ActionsOverlay/ThreeDotsMenuHoverOverlay/index.js
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
var _buttons = require('@baseapp-frontend/design-system/components/web/buttons');
var _icons = require('@baseapp-frontend/design-system/components/web/icons');
var _popovers = require('@baseapp-frontend/design-system/components/web/popovers');
var _material = require('@mui/material');
var _jsxruntime = require('react/jsx-runtime');
var ThreeDotsMenuHoverOverlay = function ThreeDotsMenuHoverOverlay2(_ref) {
  var offsetRight = _ref.offsetRight, offsetTop = _ref.offsetTop, showDeleteButton = _ref.showDeleteButton, isDeletingItem = _ref.isDeletingItem, disableDeleteButton = _ref.disableDeleteButton, handleDeleteDialogOpen = _ref.handleDeleteDialogOpen, _ref$actions = _ref.actions, actions = _ref$actions === void 0 ? [] : _ref$actions, handleClosePopover = _ref.handleClosePopover, popover = _ref.popover;
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkGIOWIKTQjs.ActionOverlayTooltipContainer, {
    offsetRight,
    offsetTop,
    "aria-label": "actions overlay",
    sx: {
      position: "unset",
      marginX: "4px",
      borderRadius: "500px",
      alignSelf: "baseline"
    },
    children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _buttons.IconButton, {
      onClick: popover.onOpen,
      "aria-label": "Show menu options",
      children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.ThreeDotsIcon, {
        sx: {
          fontSize: "18px"
        }
      })
    }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _popovers.Popover, {
      open: popover.open,
      onClose: handleClosePopover,
      children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.MenuList, {
        children: [actions === null || actions === void 0 ? void 0 : actions.map(function(_ref2) {
          var label = _ref2.label, icon = _ref2.icon, _onClick = _ref2.onClick, disabled = _ref2.disabled, hasPermission = _ref2.hasPermission;
          if (!hasPermission) return null;
          return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.MenuItem, {
            onClick: function onClick() {
              _onClick === null || _onClick === void 0 || _onClick();
              handleClosePopover();
            },
            disabled,
            children: [icon, /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
              variant: "body2",
              color: "text.primary",
              children: label
            })]
          }, label);
        }), showDeleteButton && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.MenuItem, {
          onClick: handleDeleteDialogOpen,
          disabled: isDeletingItem || disableDeleteButton,
          color: "disabled",
          children: [/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.TrashCanIcon, {
            sx: {
              color: disableDeleteButton ? "text.disabled" : "error.main"
            }
          }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Typography, {
            variant: "body2",
            color: disableDeleteButton ? "text.disabled" : "error.main",
            children: "Delete"
          })]
        })]
      })
    })]
  });
};
var ThreeDotsMenuHoverOverlay_default = ThreeDotsMenuHoverOverlay;



exports.ThreeDotsMenuHoverOverlay_default = ThreeDotsMenuHoverOverlay_default;
//# sourceMappingURL=chunk-224VTDDC.js.map