import _extends from "@babel/runtime/helpers/extends";
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
import React from 'react';
import { SmartLinkSize } from '../../../../../../constants';
import { LoadingSkeleton } from '../../../common/loading-skeleton';
import { LinkIcon } from '../../../elements';
import { getIconWidth } from '../../../utils';
import Block from '../../block';
/**
 * This represents a TitleBlock for a Smart Link that is currently waiting
 * for a request to finish.
 * This should render when a Smart Link has sent a request.
 * @see TitleBlock
 */
const TitleBlockResolvingView = ({
  actionGroup,
  icon,
  position,
  testId,
  title,
  hideIcon,
  ...blockProps
}) => {
  const {
    size = SmartLinkSize.Medium
  } = blockProps;
  const iconWidth = getIconWidth(size);
  return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
    testId: `${testId}-resolving-view`
  }), !hideIcon && icon && /*#__PURE__*/React.createElement(LinkIcon, {
    overrideIcon: icon,
    position: position,
    size: size,
    hideLoadingSkeleton: true
  }), !hideIcon && !icon && /*#__PURE__*/React.createElement("span", {
    style: {
      width: iconWidth,
      height: iconWidth
    },
    "data-testid": `${testId}-icon`
  }, /*#__PURE__*/React.createElement(LoadingSkeleton, {
    width: iconWidth,
    height: iconWidth,
    testId: `${testId}-icon-loading`
  })), title, actionGroup);
};
export default TitleBlockResolvingView;