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

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
require("./index.compiled.css");
var _runtime = require("@compiled/react/runtime");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _reactIntl = require("react-intl");
var _css = require("@atlaskit/css");
var _compiled = require("@atlaskit/primitives/compiled");
var _constants = require("../../../../../constants");
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
var styles = {
  button: "_1e0c1bgi",
  padding: "_18zrutpp",
  message: "_1rjcze3t _18zrze3t"
};
var UnresolvedAction = function UnresolvedAction(_ref) {
  var _context$actions;
  var _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId,
    _ref$hasPadding = _ref.hasPadding,
    hasPadding = _ref$hasPadding === void 0 ? false : _ref$hasPadding;
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
  var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.UnresolvedAction];
  if (!data) {
    return null;
  }
  var descriptor = data.descriptor,
    onClick = data.onClick,
    values = data.values;
  var hasAction = onClick !== undefined;
  var message = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
    testId: "".concat(testId, "-errored-view-message"),
    tabIndex: hasAction ? 0 : undefined,
    xcss: (0, _css.cx)(styles.message, hasPadding && styles.padding)
  }, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, descriptor, {
    values: values
  })));
  return hasAction ? /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
    onClick: data.onClick,
    style: {
      color: "inherit",
      font: "inherit",
      textAlign: "inherit"
    },
    xcss: styles.button
  }, message) : message;
};
var _default = exports.default = UnresolvedAction;