Buckets:
| 'use client' | |
| import React from 'react' | |
| import { handleISRError } from '../handle-isr-error' | |
| import { errorStyles, errorThemeCss, WarningIcon } from './error-styles' | |
| export type GlobalErrorComponent = React.ComponentType<{ | |
| error: any | |
| reset: () => void | |
| unstable_retry: () => void | |
| }> | |
| function DefaultGlobalError({ error }: { error: any }) { | |
| const digest: string | undefined = error?.digest | |
| const isServerError = !!digest | |
| const message = isServerError | |
| ? 'A server error occurred. Reload to try again.' | |
| : 'Reload to try again, or go back.' | |
| handleISRError({ error }) | |
| return ( | |
| <html id="__next_error__"> | |
| <head> | |
| <style dangerouslySetInnerHTML={{ __html: errorThemeCss }} /> | |
| </head> | |
| <body> | |
| <div style={errorStyles.container}> | |
| <div style={errorStyles.card}> | |
| <WarningIcon /> | |
| <h1 style={errorStyles.title}>This page couldn’t load</h1> | |
| <p style={errorStyles.message}>{message}</p> | |
| <div style={errorStyles.buttonGroup}> | |
| <form style={errorStyles.form}> | |
| <button type="submit" style={errorStyles.button}> | |
| Reload | |
| </button> | |
| </form> | |
| {!isServerError && ( | |
| <button | |
| type="button" | |
| style={errorStyles.buttonSecondary} | |
| onClick={() => { | |
| if (window.history.length > 1) { | |
| window.history.back() | |
| } else { | |
| window.location.href = '/' | |
| } | |
| }} | |
| > | |
| Back | |
| </button> | |
| )} | |
| </div> | |
| </div> | |
| </div> | |
| {digest && <p style={errorStyles.digestFooter}>ERROR {digest}</p>} | |
| </body> | |
| </html> | |
| ) | |
| } | |
| // Exported so that the import signature in the loaders can be identical to user | |
| // supplied custom global error signatures. | |
| export default DefaultGlobalError | |
Xet Storage Details
- Size:
- 2.02 kB
- Xet hash:
- 8d8c4d5bd59add998703015b1a211944c7adca465dbe4bbbfb85afd27a3dc21b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.