/* index.tsx generated by @compiled/babel-plugin v0.38.1 */
import "./index.compiled.css";
import { ax, ix } from "@compiled/react/runtime";
import React from 'react';
import { Box } from '@atlaskit/primitives/compiled';
import Spinner from '@atlaskit/spinner';
import { Frame } from '../Frame';
import { IconAndTitleLayout, IconTitleWrapper } from '../IconAndTitleLayout';
import { RightIconPositionWrapper } from '../IconAndTitleLayout/styled';
var styles = {
  spinnerWrapper: "_11c81o8v _1e0c116y _4cvr1h6o _1bah1h6o _4t3i7vkz _1bsb7vkz"
};
export var 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.useCallback(function () {
    return /*#__PURE__*/React.createElement(Box, {
      as: "span",
      xcss: styles.spinnerWrapper
    }, /*#__PURE__*/React.createElement(Spinner, {
      size: 14,
      interactionName: "smart-card-inline-card-spinner"
    }));
  }, []);
  if (inlinePreloaderStyle === 'on-right-without-skeleton') {
    return /*#__PURE__*/React.createElement(Frame, {
      withoutBackground: true,
      testId: testId,
      onClick: onClick,
      isSelected: isSelected,
      truncateInline: truncateInline
    }, /*#__PURE__*/React.createElement(IconTitleWrapper, null, url, /*#__PURE__*/React.createElement(RightIconPositionWrapper, null, renderSpinner())));
  }
  return /*#__PURE__*/React.createElement(Frame, {
    testId: testId,
    onClick: onClick,
    isSelected: isSelected,
    link: url,
    truncateInline: truncateInline
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
    icon: renderSpinner(),
    title: resolvingPlaceholder !== null && resolvingPlaceholder !== void 0 ? resolvingPlaceholder : url,
    titleTextColor: titleTextColor
  }));
};