/* 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';
const styles = {
  spinnerWrapper: "_11c8wadc _1e0c116y _4cvr1h6o _1bah1h6o _4t3i7vkz _1bsb7vkz"
};
export const InlineCardResolvingView = ({
  url,
  onClick,
  isSelected,
  inlinePreloaderStyle,
  testId = 'inline-card-resolving-view',
  titleTextColor,
  resolvingPlaceholder,
  truncateInline
}) => {
  const renderSpinner = React.useCallback(() => /*#__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
  }));
};