import React from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { LoadingCardLink } from '../component-lazy/LoadingCardLink';
const CardErrorBoundary = ({
  children,
  ...props
}) => {
  // TODO: NAVX-4682: Add feature parity to CardWithURLRenderer
  const ErrorFallbackComponent = props.fallbackComponent;
  const errorBoundaryFallbackComponent = () => {
    if (ErrorFallbackComponent) {
      return /*#__PURE__*/React.createElement(ErrorFallbackComponent, null);
    }
    return /*#__PURE__*/React.createElement(LoadingCardLink, props);
  };
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
    FallbackComponent: errorBoundaryFallbackComponent
  }, children);
};
export default CardErrorBoundary;