import { __assign } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import ErrorBoundary from './ErrorBoundary';
function catchError(_a) {
    var _b = _a === void 0 ? {} : _a, FallbackComponent = _b.FallbackComponent, onError = _b.onError;
    return function catchErrorInner(BaseComponent) {
        return function CatchError(props) {
            return (_jsx(ErrorBoundary, __assign({ FallbackComponent: FallbackComponent, onError: onError }, { children: _jsx(BaseComponent, __assign({}, props), void 0) }), void 0));
        };
    };
}
export default catchError;
