"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _constants = require("../../../../../constants");
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
var _resolved = _interopRequireDefault(require("./resolved"));
var _excluded = ["testId"];
/**
 * 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 = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var cardContext = (0, _flexibleUiContext.useFlexibleCardContext)();
  if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== _constants.SmartLinkStatus.Resolved) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement(_resolved.default, (0, _extends2.default)({}, 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
  }));
};
var _default = exports.default = AIFooterBlock;