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

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.blockCardIconImageClassName = exports.Icon = void 0;
require("./Icon.compiled.css");
var _runtime = require("@compiled/react/runtime");
var _react = _interopRequireDefault(require("react"));
var _reactRenderImage = _interopRequireDefault(require("react-render-image"));
var _link = _interopRequireDefault(require("@atlaskit/icon/core/migration/link"));
/**
 * Class name for selecting non-flexible block card icon image
 *
 * @deprecated {@link https://hello.jira.atlassian.cloud/browse/ENGHEALTH-6878 Internal documentation for deprecation (no external access)}
 * Using this selctor is deprecated as once the flexible block card feature flag is removed, this class will no longer be used.
 */
var blockCardIconImageClassName = exports.blockCardIconImageClassName = 'block-card-icon-image';
var imageStyles = null;
var spanStyles = null;
var Icon = exports.Icon = function Icon(_ref) {
  var url = _ref.url,
    icon = _ref.icon,
    defaultIcon = _ref.defaultIcon,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'block-card-icon' : _ref$testId,
    _ref$isFlexibleUi = _ref.isFlexibleUi,
    isFlexibleUi = _ref$isFlexibleUi === void 0 ? false : _ref$isFlexibleUi;
  var placeholder = defaultIcon || /*#__PURE__*/_react.default.createElement(_link.default, {
    label: "link",
    LEGACY_size: "small",
    testId: "".concat(testId, "-default"),
    color: "currentColor"
  });
  var image = url && /*#__PURE__*/_react.default.createElement(_reactRenderImage.default, {
    src: url,
    loaded: /*#__PURE__*/_react.default.createElement("img", {
      src: url,
      alt: "",
      "data-testid": "".concat(testId, "-image"),
      className: (0, _runtime.ax)([isFlexibleUi && "_4t3i7vkz _1bsb7vkz"])
    }),
    errored: placeholder
  });
  return /*#__PURE__*/_react.default.createElement("span", {
    "data-testid": testId
    // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
    ,
    className: (0, _runtime.ax)([isFlexibleUi && "_4t3igktf _1bsb7vkz _1e0c1txw _4cvr1h6o _1bah1h6o", blockCardIconImageClassName])
  }, icon || image || placeholder);
};