mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-08-31 08:39:24 +00:00
c9b8fb7809
* Introduced tsconfig.app.json and tsconfig.base.json * yarn.lock * Introduced tsconfig.app.json, tsconfig.base.jsonfig. * Refactored eslint.config.js to latest structure * Returned previous recommended rules. * More rules * Force import rules * Check * Check * Cleanup ESLint configuration and plugins * Cleanup heap: "writable",DD_RUM: "writable" from ESLint configuration * "scripts" moved to the top of package.json
35 lines
965 B
TypeScript
35 lines
965 B
TypeScript
import type { FallbackProps } from "react-error-boundary";
|
|
|
|
import { useDevLogger } from "../../hooks/useDevLogger";
|
|
import GlobalErrorModal from "../modal/GlobalErrorModal";
|
|
|
|
/**
|
|
* Error fallback component for React Error Boundary
|
|
* Uses the existing GlobalErrorModal for consistent error display
|
|
* @param error - The error that was caught
|
|
* @param resetErrorBoundary - Function to reset the error boundary state
|
|
*/
|
|
const ErrorFallback = ({ error, resetErrorBoundary }: FallbackProps) => {
|
|
useDevLogger(error);
|
|
|
|
const handleClose = () => {
|
|
// Reset the error boundary to allow the component tree to re-render
|
|
resetErrorBoundary();
|
|
};
|
|
|
|
return (
|
|
<GlobalErrorModal
|
|
isOpen={true}
|
|
onClose={handleClose}
|
|
titleText="Application Error"
|
|
contentText={
|
|
error instanceof Error
|
|
? error.message
|
|
: "An unexpected error occurred. Please try again."
|
|
}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default ErrorFallback;
|