"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.InlineImageCardErrorView = void 0;
var _react = require("@emotion/react");
var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/warning"));
var _colors = require("@atlaskit/theme/colors");
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
var _constants = require("./constants");
var _frame = require("./frame");
var _iconWrapper = require("./icon-wrapper");
/** @jsx jsx */

var InlineImageCardErrorView = exports.InlineImageCardErrorView = function InlineImageCardErrorView(_ref) {
  var _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'media-inline-image-card-error-view' : _ref$testId,
    message = _ref.message,
    icon = _ref.icon,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? _constants.ICON_SIZE_THRESOLD : _ref$height;
  return (0, _react.jsx)(_frame.Frame, {
    testId: testId
  }, (0, _react.jsx)(_tooltip.default, {
    content: message,
    position: "top",
    tag: "span",
    hideTooltipOnClick: true
  }, (0, _react.jsx)(_iconWrapper.IconWrapper, null, icon || (0, _react.jsx)(_warning.default, {
    label: "error",
    size: height > _constants.ICON_SIZE_THRESOLD ? 'medium' : 'small',
    primaryColor: "var(--ds-icon-danger, ".concat(_colors.R300, ")")
  }))));
};