import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { SmartLinkStatus } from '../../../../../constants';
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
import AIFooterBlockResolvedView from './resolved';
/**
 * Represents a AIFooterBlock, designed to show provider metadata in
 * addition to AI tooltip icons if AI is enabled
 * @param {AIFooterBlockProps} AIFooterBlockProps
 * @see Block
 */
const AIFooterBlock = ({
  testId = 'smart-ai-footer-block',
  ...props
}) => {
  var _props$size, _cardContext$ui;
  const cardContext = useFlexibleCardContext();
  if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
    return null;
  }
  return /*#__PURE__*/React.createElement(AIFooterBlockResolvedView, _extends({}, props, {
    size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
    testId: testId
  }));
};
export default AIFooterBlock;