47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
'use client';
|
|
|
|
import Link from 'next/link';
|
|
|
|
export default function GlobalError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string };
|
|
reset: () => void;
|
|
}) {
|
|
return (
|
|
<html lang="en">
|
|
<body className="antialiased">
|
|
<main className="min-h-screen flex items-center justify-center bg-deep-graphite text-white px-6">
|
|
<div className="max-w-md text-center space-y-4">
|
|
<h1 className="text-3xl font-semibold">Something went wrong</h1>
|
|
<p className="text-sm text-gray-400">
|
|
{error?.message ? error.message : 'An unexpected error occurred.'}
|
|
</p>
|
|
{error?.digest && (
|
|
<p className="text-xs text-gray-500 font-mono">
|
|
Error ID: {error.digest}
|
|
</p>
|
|
)}
|
|
<div className="flex items-center justify-center gap-3 pt-2">
|
|
<button
|
|
type="button"
|
|
onClick={() => reset()}
|
|
className="inline-flex items-center justify-center rounded-md bg-primary-blue px-4 py-2 text-sm font-medium text-white hover:bg-primary-blue/80 transition-colors"
|
|
>
|
|
Try again
|
|
</button>
|
|
<Link
|
|
href="/"
|
|
className="inline-flex items-center justify-center rounded-md bg-iron-gray px-4 py-2 text-sm font-medium text-white hover:bg-iron-gray/80 transition-colors"
|
|
>
|
|
Go home
|
|
</Link>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|