import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["testId", "overrideUrl"];
import React from 'react';
import { useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
import PreviewBlockResolvedView from './resolved';
/**
 * Represents a PreviewBlock, which typically contains media or other large format content.
 * @public
 * @param {PreviewBlockProps} PreviewBlock
 * @see Block
 */
var PreviewBlock = function PreviewBlock(_ref) {
  var _blockProps$size;
  var _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
    overrideUrl = _ref.overrideUrl,
    blockProps = _objectWithoutProperties(_ref, _excluded);
  var ui = useFlexibleUiOptionContext();
  return /*#__PURE__*/React.createElement(PreviewBlockResolvedView, _extends({}, blockProps, {
    size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : ui === null || ui === void 0 ? void 0 : ui.size,
    testId: testId,
    overrideUrl: overrideUrl
  }));
};
export default PreviewBlock;