Files
spacedrive/packages/interface/src/ErrorFallback.tsx
Jamie Pine 69e09db158 Eng 142 fix interface hot reload (#252)
* fix interface hot reloading

* AppPropsContext exsiting in App.tsx was the issue :D

* type export fix
2022-06-18 01:35:51 -07:00

26 lines
895 B
TypeScript

import { Button } from '@sd/ui';
import React from 'react';
import { FallbackProps } from 'react-error-boundary';
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
return (
<div
data-tauri-drag-region
role="alert"
className="flex flex-col items-center justify-center w-screen h-screen p-4 border border-gray-200 rounded-lg dark:border-gray-650 bg-gray-50 dark:bg-gray-650 dark:text-white"
>
<p className="m-3 text-sm font-bold text-gray-400">APP CRASHED</p>
<h1 className="text-2xl font-bold">We're past the event horizon...</h1>
<pre className="m-2">Error: {error.message}</pre>
<div className="flex flex-row space-x-2">
<Button variant="primary" className="mt-2" onClick={resetErrorBoundary}>
Reload
</Button>
<Button className="mt-2" onClick={resetErrorBoundary}>
Send report
</Button>
</div>
</div>
);
}