"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.NestedTableDragAndDropOverlayPopover = void 0;
var _designSystem = require("@wix/design-system");
var _react = _interopRequireDefault(require("react"));
var _DepthLimitMessage = require("./DepthLimitMessage");
var _mobxReactLite = require("mobx-react-lite");
var _DragAndDropDisabledMessage = require("./DragAndDropDisabledMessage");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/NestedTableDragAndDrop/NestedTableDragAndDropOverlayPopover.tsx";
function _NestedTableDragAndDropOverlayPopover(props) {
  const {
    state,
    children
  } = props;
  const {
    reachedMaxDepth,
    dragAndDropDisabled
  } = state;
  const {
    errorMessage
  } = dragAndDropDisabled || {};
  return /*#__PURE__*/_react.default.createElement(_designSystem.Popover, {
    showArrow: true,
    shown: !!dragAndDropDisabled || reachedMaxDepth,
    appendTo: "parent",
    placement: "top",
    dataHook: "nested-table-dnd-overlay-popover",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 21,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Popover.Element, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 28,
      columnNumber: 7
    }
  }, children), /*#__PURE__*/_react.default.createElement(_designSystem.Popover.Content, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    padding: "6px 8px",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 9
    }
  }, errorMessage ? /*#__PURE__*/_react.default.createElement(_DragAndDropDisabledMessage.DragAndDropDisabledMessage, {
    message: errorMessage,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 13
    }
  }) : /*#__PURE__*/_react.default.createElement(_DepthLimitMessage.DepthLimitMessage, {
    state: state,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 13
    }
  }))));
}
const NestedTableDragAndDropOverlayPopover = exports.NestedTableDragAndDropOverlayPopover = (0, _mobxReactLite.observer)(_NestedTableDragAndDropOverlayPopover);
//# sourceMappingURL=NestedTableDragAndDropOverlayPopover.js.map