/* main.tsx generated by @compiled/babel-plugin v0.39.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AutomationModalExecutionState = void 0;
require("./main.compiled.css");
var React = _interopRequireWildcard(require("react"));
var _runtime = require("@compiled/react/runtime");
var _reactIntl = require("react-intl");
var _compiled = require("@atlaskit/primitives/compiled");
var _sectionMessage = _interopRequireDefault(require("@atlaskit/section-message"));
var _menuContext = require("../../menu-context");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var styles = {
  messageStyling: "_195g1ejb _19pku2gc _otyrx0bf"
};
var i18n = (0, _reactIntl.defineMessages)({
  ruleExecutionSuccessMessage: {
    id: 'automation-menu.success-state.message',
    defaultMessage: 'Your automation is in progress',
    description: 'Message that is displayed when a users automation rule has been successfully queued.'
  },
  ruleExecutionErrorMessage: {
    id: 'automation-menu.modal.error.description',
    defaultMessage: 'Oops we ran into a problem',
    description: "Description for the error section shown when rules can't be executed"
  }
});
var AutomationModalExecutionState = exports.AutomationModalExecutionState = function AutomationModalExecutionState() {
  var _useAutomationMenu = (0, _menuContext.useAutomationMenu)(),
    ruleExecutionState = _useAutomationMenu.ruleExecutionState;
  if (ruleExecutionState === 'FAILURE') {
    return /*#__PURE__*/React.createElement(_compiled.Box, {
      xcss: styles.messageStyling
    }, /*#__PURE__*/React.createElement(_sectionMessage.default, {
      appearance: "error"
    }, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, i18n.ruleExecutionErrorMessage)));
  } else {
    return null;
  }
};