forked from niharika-mente/DevEvent_Tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.tsx
More file actions
43 lines (40 loc) · 1.21 KB
/
Copy patherror.tsx
File metadata and controls
43 lines (40 loc) · 1.21 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
"use client";
import { useEffect } from "react";
import Link from "next/link";
import { captureException } from "@/lib/posthog/helpers";
export default function ErrorPage({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
console.error(error);
captureException(error, { digest: error.digest });
}, [error]);
return (
<div className="flex min-h-screen flex-col items-center justify-center bg-background text-foreground px-4 text-center">
<h1 className="text-5xl font-bold mb-4 bg-gradient-to-r from-cyan-400 to-blue-500 bg-clip-text text-transparent">
Something went wrong
</h1>
<p className="text-muted-foreground mb-6">
An unexpected error occurred. Please try again.
</p>
<div className="flex gap-4">
<button
onClick={() => reset()}
className="px-6 py-3 rounded-lg bg-gradient-to-r from-cyan-500 to-blue-600 hover:opacity-90 transition"
>
Try again
</button>
<Link
href="/"
className="px-6 py-3 rounded-lg border border-border hover:bg-accent transition"
>
Go home
</Link>
</div>
</div>
);
}