"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _reactErrorBoundary = require("react-error-boundary");
var _LoadingCardLink = require("../component-lazy/LoadingCardLink");
var _excluded = ["children"];
var CardErrorBoundary = function CardErrorBoundary(_ref) {
  var children = _ref.children,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  // TODO: NAVX-4682: Add feature parity to CardWithURLRenderer
  var ErrorFallbackComponent = props.fallbackComponent;
  var errorBoundaryFallbackComponent = function errorBoundaryFallbackComponent() {
    if (ErrorFallbackComponent) {
      return /*#__PURE__*/_react.default.createElement(ErrorFallbackComponent, null);
    }
    return /*#__PURE__*/_react.default.createElement(_LoadingCardLink.LoadingCardLink, props);
  };
  return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
    FallbackComponent: errorBoundaryFallbackComponent
  }, children);
};
var _default = exports.default = CardErrorBoundary;