"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CardActions = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _designSystem = require("@wix/design-system");
var _useCardActions = require("./useCardActions");
var _ActionModal = require("../ActionModal");
var _DisabledTooltip = require("../DisabledTooltip");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/Kanban/CardActions.tsx";
function _CardActions({
  actionCell,
  originalItem,
  itemIndex,
  itemActionsState,
  stageKey,
  item,
  state
}) {
  const {
    secondaryActions,
    primaryActionProps: _primaryActionProps
  } = (0, _useCardActions.useCardActions)({
    actionCell,
    originalItem,
    itemIndex,
    itemActionsState,
    stageKey,
    cardKey: item.key,
    state
  });
  const primaryActionProps = _primaryActionProps;
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, itemActionsState.confirmModal.value && /*#__PURE__*/_react.default.createElement(_ActionModal.MessageActionModal, (0, _extends2.default)({
    state: itemActionsState.confirmModal
  }, itemActionsState.confirmModal.value, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 48,
      columnNumber: 9
    }
  })), /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    gap: "9px",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 53,
      columnNumber: 7
    }
  }, secondaryActions, primaryActionProps && /*#__PURE__*/_react.default.createElement(_DisabledTooltip.DisabledTooltip, {
    content: primaryActionProps.disabledMessage,
    disabled: !primaryActionProps.disabled,
    dataHook: `kanban-card-primary-action-tooltip-${stageKey}-${item.key}`,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 56,
      columnNumber: 11
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.Button, {
    style: {
      zIndex: 50
    },
    size: "tiny",
    priority: "secondary",
    onClick: e => {
      e.stopPropagation();
      primaryActionProps.onClick();
    },
    disabled: primaryActionProps.disabled,
    prefixIcon: primaryActionProps.prefixIcon,
    dataHook: `kanban-card-primary-action-${stageKey}-${item.key}`,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 61,
      columnNumber: 13
    }
  }, primaryActionProps.text))));
}
const CardActions = exports.CardActions = (0, _mobxReactLite.observer)(_CardActions);
//# sourceMappingURL=CardActions.js.map