website refactor
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { ErrorPageContainer } from '@/ui/ErrorPageContainer';
|
||||
import { ErrorActionButtons } from '@/ui/ErrorActionButtons';
|
||||
import { Text } from '@/ui/Text';
|
||||
import { routes } from '@/lib/routing/RouteConfig';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
export default function ErrorPage({
|
||||
error,
|
||||
@@ -9,29 +13,23 @@ export default function ErrorPage({
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<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>
|
||||
<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>
|
||||
<ErrorPageContainer
|
||||
errorCode="Error"
|
||||
description={error?.message || 'An unexpected error occurred.'}
|
||||
>
|
||||
{error?.digest && (
|
||||
<Text size="xs" color="text-gray-500" font="mono">
|
||||
Error ID: {error.digest}
|
||||
</Text>
|
||||
)}
|
||||
<ErrorActionButtons
|
||||
onRetry={reset}
|
||||
onHomeClick={() => router.push(routes.public.home)}
|
||||
showRetry={true}
|
||||
/>
|
||||
</ErrorPageContainer>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user