import * as React from 'react';
// @ts-ignore flow import
import PreviewError from './PreviewError';
import { PreviewLoading } from '../../components/preview';
import './PreviewMask.scss';
export default function PreviewMask({
  errorCode,
  extension,
  isLoading,
  isLoadingDeferred = false
}) {
  if (errorCode) {
    return /*#__PURE__*/React.createElement("div", {
      className: "bcpr-PreviewMask"
    }, /*#__PURE__*/React.createElement(PreviewError, {
      errorCode: errorCode
    }));
  }
  if (isLoading) {
    return /*#__PURE__*/React.createElement("div", {
      className: "bcpr-PreviewMask"
    }, !isLoadingDeferred && /*#__PURE__*/React.createElement(PreviewLoading, {
      extension: extension
    }));
  }
  return null;
}
//# sourceMappingURL=PreviewMask.js.map