import React from 'react';
import { HoverCard } from '../../HoverCard';
import { Frame } from '../Frame';
import { IconAndTitleLayout } from '../IconAndTitleLayout';
import { renderLozenge } from './renderLozenge';
export 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.createElement(Frame, {
    testId: testId,
    link: link,
    isSelected: isSelected,
    isHovered: isHovered,
    onClick: onClick,
    truncateInline: truncateInline
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
    emoji: titlePrefix,
    icon: icon,
    title: title,
    titleTextColor: titleTextColor,
    type: type,
    hideIconLoadingSkeleton: hideIconLoadingSkeleton
  }), renderLozenge(lozenge));
  if (!showHoverPreview || !link) {
    return frame;
  }
  return /*#__PURE__*/React.createElement(HoverCard, {
    id: id,
    url: link,
    actionOptions: actionOptions,
    hoverPreviewOptions: hoverPreviewOptions
  }, frame);
}