forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal-error.tsx
More file actions
48 lines (44 loc) · 1.49 KB
/
Copy pathglobal-error.tsx
File metadata and controls
48 lines (44 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"use client";
import { Space_Grotesk, IBM_Plex_Mono } from "next/font/google";
const spaceGrotesk = Space_Grotesk({
variable: "--font-space-grotesk",
subsets: ["latin"],
display: "swap",
});
const ibmPlexMono = IBM_Plex_Mono({
variable: "--font-ibm-plex-mono",
subsets: ["latin"],
weight: ["400", "500"],
display: "swap",
});
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
return (
<html
lang="en"
className={`${spaceGrotesk.variable} ${ibmPlexMono.variable}`}
>
<body className="min-h-screen bg-[var(--color-surface)] text-[var(--color-ink)] font-[family-name:var(--font-space-grotesk)] flex items-center justify-center p-6">
<div className="max-w-md w-full space-y-6 text-center">
<h1 className="text-2xl font-bold tracking-tight">
Something went wrong
</h1>
<p className="text-[var(--color-text-muted)] font-[family-name:var(--font-ibm-plex-mono)] text-sm break-words">
{error.message || "An unexpected error occurred"}
</p>
<button
onClick={reset}
className="inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[var(--color-accent)] text-white font-medium hover:opacity-90 transition-opacity focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[var(--color-accent)]"
>
Try again
</button>
</div>
</body>
</html>
);
}