/* index.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.InlineCardResolvingView = void 0;
require("./index.compiled.css");
var _runtime = require("@compiled/react/runtime");
var _react = _interopRequireDefault(require("react"));
var _compiled = require("@atlaskit/primitives/compiled");
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
var _Frame = require("../Frame");
var _IconAndTitleLayout = require("../IconAndTitleLayout");
var _styled = require("../IconAndTitleLayout/styled");
var styles = {
  spinnerWrapper: "_11c81o8v _1e0c116y _4cvr1h6o _1bah1h6o _4t3i7vkz _1bsb7vkz"
};
var InlineCardResolvingView = exports.InlineCardResolvingView = function InlineCardResolvingView(_ref) {
  var url = _ref.url,
    onClick = _ref.onClick,
    isSelected = _ref.isSelected,
    inlinePreloaderStyle = _ref.inlinePreloaderStyle,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'inline-card-resolving-view' : _ref$testId,
    titleTextColor = _ref.titleTextColor,
    resolvingPlaceholder = _ref.resolvingPlaceholder,
    truncateInline = _ref.truncateInline;
  var renderSpinner = _react.default.useCallback(function () {
    return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
      as: "span",
      xcss: styles.spinnerWrapper
    }, /*#__PURE__*/_react.default.createElement(_spinner.default, {
      size: 14,
      interactionName: "smart-card-inline-card-spinner"
    }));
  }, []);
  if (inlinePreloaderStyle === 'on-right-without-skeleton') {
    return /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
      withoutBackground: true,
      testId: testId,
      onClick: onClick,
      isSelected: isSelected,
      truncateInline: truncateInline
    }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconTitleWrapper, null, url, /*#__PURE__*/_react.default.createElement(_styled.RightIconPositionWrapper, null, renderSpinner())));
  }
  return /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
    testId: testId,
    onClick: onClick,
    isSelected: isSelected,
    link: url,
    truncateInline: truncateInline
  }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
    icon: renderSpinner(),
    title: resolvingPlaceholder !== null && resolvingPlaceholder !== void 0 ? resolvingPlaceholder : url,
    titleTextColor: titleTextColor
  }));
};