main
tsx 22 lines 605 Bytes
Raw
1 import './fatal-error.css'
2 import { Button } from './button.tsx'
3 import { ErrorPanel } from './error.tsx'
4 import { FloatingPanel } from './floating-panel.tsx'
5 import type { JSX } from 'react'
6
7 interface FatalErrorPanelProps {
8 error: Error
9 onBack?(evt: React.UIEvent): void
10 }
11
12 export function FatalErrorPanel ({ error, onBack }: FatalErrorPanelProps): JSX.Element {
13 return (
14 <>
15 <FloatingPanel className='FatalErrorPanel'>
16 <h2>Error</h2>
17 <ErrorPanel error={error} />
18 {onBack != null ? <Button onClick={onBack}>Back</Button> : ''}
19 </FloatingPanel>
20 </>
21 )
22 }