37 lines
1013 B
TypeScript
37 lines
1013 B
TypeScript
|
|
'use client';
|
||
|
|
|
||
|
|
// global-error replaces the root layout: no providers, so it brings the bootstrap, styles and i18n.
|
||
|
|
import '../bootstrap/bootstrap.client';
|
||
|
|
import '../styles/app.css';
|
||
|
|
|
||
|
|
import { Element } from '@lumina/island/primitives/element';
|
||
|
|
import { ErrorFallback } from '@lumina/market/app/error-boundaries';
|
||
|
|
|
||
|
|
import { i18n } from '../i18n/i18n.client';
|
||
|
|
import { yekanBakh } from '../styles';
|
||
|
|
|
||
|
|
type GlobalErrorProps = {
|
||
|
|
error: Error & { digest?: string };
|
||
|
|
};
|
||
|
|
|
||
|
|
/** The app boundary (EB-W): the last resort when nothing below caught the error. */
|
||
|
|
export default function GlobalError({ error }: GlobalErrorProps) {
|
||
|
|
return (
|
||
|
|
<Element
|
||
|
|
tag="html"
|
||
|
|
lang={i18n.language}
|
||
|
|
dir={i18n.dir()}
|
||
|
|
className={yekanBakh.variable}
|
||
|
|
>
|
||
|
|
<Element tag="body">
|
||
|
|
<Element tag="meta" name="robots" content="noindex" />
|
||
|
|
<ErrorFallback
|
||
|
|
error={error}
|
||
|
|
size="app"
|
||
|
|
onRetry={() => window.location.reload()}
|
||
|
|
/>
|
||
|
|
</Element>
|
||
|
|
</Element>
|
||
|
|
);
|
||
|
|
}
|