ConceptPortal-public/rsconcept/frontend/src/components/ErrorFallback.tsx

17 lines
523 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { type FallbackProps } from 'react-error-boundary';
import Button from './common/Button';
function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
reportError(error);
return (
<div className='flex flex-col items-center antialiased clr-app' role='alert'>
<h1 className='text-lg font-semibold'>Что-то пошло не так!</h1>
{error}
<Button onClick={resetErrorBoundary} text='Попробовать еще раз' />
</div>
);
}
export default ErrorFallback;