diff --git a/resources/js/pages/error.tsx b/resources/js/pages/error.tsx index 9b32769..8297595 100644 --- a/resources/js/pages/error.tsx +++ b/resources/js/pages/error.tsx @@ -19,7 +19,7 @@ type PanelProp = { }; type Props = { - panel: PanelProp; + panel?: PanelProp; status: number; title: string; message: string; @@ -32,24 +32,33 @@ function iconFor(status: number) { } export default function ErrorPage({ panel, status, title, message }: Props) { - const __ = create__(panel.translations ?? {}); + const __ = create__(panel?.translations ?? {}); const Icon = iconFor(status); + const homeHref = panel?.path ? `/${panel.path}` : '/'; - return ( - -
-
- -
-

{status}

-

{title}

-

{message}

-
- -
+ const body = ( +
+
+
- +

{status}

+

{title}

+

{message}

+
+ +
+
); + + if (!panel) { + return ( +
+ {body} +
+ ); + } + + return {body}; }