mirror of
https://github.com/twentyhq/twenty.git
synced 2026-06-13 10:29:34 -04:00
* - Changed to objectNameSingular always defined - Added ErrorCatchAll * - Added mock mode for companies logged out - Added a proper ErrorBoundary component * Removed react-error-boundary * Implemented proper ErrorBoundary * Fixes * Change strategy about mocks --------- Co-authored-by: Charles Bochet <charles@twenty.com>
27 lines
589 B
TypeScript
27 lines
589 B
TypeScript
import { FallbackProps } from 'react-error-boundary';
|
|
|
|
type GenericErrorFallbackProps = FallbackProps;
|
|
|
|
export const GenericErrorFallback = ({
|
|
error,
|
|
resetErrorBoundary,
|
|
}: GenericErrorFallbackProps) => {
|
|
return (
|
|
<div
|
|
style={{
|
|
color: 'red',
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
gap: '20px',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
width: '100%',
|
|
height: '100%',
|
|
}}
|
|
>
|
|
<div>{error.message}</div>
|
|
<button onClick={() => resetErrorBoundary()}>Retry</button>
|
|
</div>
|
|
);
|
|
};
|