UNPKG

@wener/console

Version:

Base console UI toolkit

19 lines (18 loc) 846 B
import React from "react"; import { ErrorSuspenseBoundary as _ErrorSuspenseBoundary } from "@wener/reaction"; import { LoadingIndicator } from "../../../loader/index.js"; import { PageErrorState } from "./PageErrorState.js"; export const ErrorSuspenseBoundary = ({ title, fallback = /*#__PURE__*/ React.createElement(LoadingIndicator, null), onError = ({ error, errorInfo }) => { console.error(`[ErrorSuspenseBoundary]`, errorInfo, error); }, children }) => { return /*#__PURE__*/ React.createElement(_ErrorSuspenseBoundary, { fallback: fallback, renderError: (props) => /*#__PURE__*/ React.createElement(PageErrorState, { error: props.error, onReset: props.reset, title: title }), onError: onError }, children); }; //# sourceMappingURL=ErrorSuspenseBoundary.js.map