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

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ActionFooter = void 0;
require("./index.compiled.css");
var React = _interopRequireWildcard(require("react"));
var _runtime = require("@compiled/react/runtime");
var _statusError = _interopRequireDefault(require("@atlaskit/icon/core/status-error"));
var _compiled = require("@atlaskit/primitives/compiled");
var _motionWrapper = _interopRequireDefault(require("../../../common/motion-wrapper"));
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 = {
  containerStyles: "_kkk2n7od _2rko12b0 _1rjc12x7 _18zru2gc _19pku2gc _2hwxu2gc _otyrze3t _18u0u2gc _1bsb1osq _fiawglyw",
  errorContentStyles: "_bozgv77o",
  titleStyles: "_11c8rymc _syazazsu"
};
var getIcon = function getIcon(appearance) {
  switch (appearance) {
    case 'error':
      return /*#__PURE__*/React.createElement(_statusError.default, {
        color: "var(--ds-icon-danger, #C9372C)",
        spacing: "compact",
        label: "Error",
        testId: "action-error-icon",
        size: "small"
      });
    default:
      return null;
  }
};
var ActionFooter = exports.ActionFooter = function ActionFooter(_ref) {
  var message = _ref.message,
    testId = _ref.testId;
  if (!message) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_compiled.Box, {
    backgroundColor: message.appearance === 'error' ? 'color.background.danger' : undefined,
    testId: "".concat(testId, "-footer"),
    style: {
      width: "calc(100% - var(--container-padding-left) - var(--container-padding-right))"
    },
    xcss: styles.containerStyles
  }, /*#__PURE__*/React.createElement(_motionWrapper.default, {
    isFadeIn: true,
    show: true,
    showTransition: true
  }, /*#__PURE__*/React.createElement(_compiled.Inline, {
    alignBlock: "start",
    grow: "fill",
    space: "space.075",
    xcss: styles.errorContentStyles
  }, message.icon || getIcon(message.appearance), /*#__PURE__*/React.createElement(_compiled.Box, {
    xcss: styles.titleStyles
  }, message.title))));
};