Fallback.tsx
23 lines
| 1 | import {__} from "@wordpress/i18n"; |
| 2 | import styles from "./styles.module.scss"; |
| 3 | |
| 4 | /** |
| 5 | * @unrestricted |
| 6 | */ |
| 7 | export default function Fallback({error, resetErrorBoundary}) { |
| 8 | return ( |
| 9 | <div role="alert" className={styles.errorBoundary}> |
| 10 | <p className={styles.errorBoundaryParagraph}> |
| 11 | {__( |
| 12 | 'An error occurred. The error message is:', |
| 13 | 'give' |
| 14 | )} |
| 15 | </p> |
| 16 | <pre className={styles.errorBoundaryPre}>{error.message}</pre> |
| 17 | <button type="button" onClick={resetErrorBoundary} className={styles.errorBoundaryButton}> |
| 18 | {__('Reload page', 'give')} |
| 19 | </button> |
| 20 | </div> |
| 21 | ); |
| 22 | } |
| 23 |