"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.InlineCardResolvedViewFunctional = InlineCardResolvedViewFunctional;
var _react = _interopRequireDefault(require("react"));
var _HoverCard = require("../../HoverCard");
var _Frame = require("../Frame");
var _IconAndTitleLayout = require("../IconAndTitleLayout");
var _renderLozenge = require("./renderLozenge");
function InlineCardResolvedViewFunctional(_ref) {
  var id = _ref.id,
    _ref$title = _ref.title,
    title = _ref$title === void 0 ? '' : _ref$title,
    isSelected = _ref.isSelected,
    isHovered = _ref.isHovered,
    onClick = _ref.onClick,
    icon = _ref.icon,
    link = _ref.link,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'inline-card-resolved-view' : _ref$testId,
    titleTextColor = _ref.titleTextColor,
    titlePrefix = _ref.titlePrefix,
    _ref$showHoverPreview = _ref.showHoverPreview,
    showHoverPreview = _ref$showHoverPreview === void 0 ? false : _ref$showHoverPreview,
    hoverPreviewOptions = _ref.hoverPreviewOptions,
    actionOptions = _ref.actionOptions,
    truncateInline = _ref.truncateInline,
    type = _ref.type,
    hideIconLoadingSkeleton = _ref.hideIconLoadingSkeleton,
    lozenge = _ref.lozenge;
  var frame = /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
    testId: testId,
    link: link,
    isSelected: isSelected,
    isHovered: isHovered,
    onClick: onClick,
    truncateInline: truncateInline
  }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
    emoji: titlePrefix,
    icon: icon,
    title: title,
    titleTextColor: titleTextColor,
    type: type,
    hideIconLoadingSkeleton: hideIconLoadingSkeleton
  }), (0, _renderLozenge.renderLozenge)(lozenge));
  if (!showHoverPreview || !link) {
    return frame;
  }
  return /*#__PURE__*/_react.default.createElement(_HoverCard.HoverCard, {
    id: id,
    url: link,
    actionOptions: actionOptions,
    hoverPreviewOptions: hoverPreviewOptions
  }, frame);
}