import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["testId"];
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
 */
var AIFooterBlock = function AIFooterBlock(_ref) {
  var _props$size, _cardContext$ui;
  var _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'smart-ai-footer-block' : _ref$testId,
    props = _objectWithoutProperties(_ref, _excluded);
  var 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 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
    testId: testId
  }));
};
export default AIFooterBlock;