File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"use client" ;
22
3- import NextError from "next/error ";
3+ import "./globals.css ";
44import posthog from "posthog-js" ;
55import { useEffect } from "react" ;
6+ import { Button } from "@/components/ui/button" ;
67
78export default function GlobalError ( {
8- error,
9- reset,
9+ error,
10+ reset,
1011} : {
11- error : Error & { digest ?: string } ;
12- reset : ( ) => void ;
12+ error : Error & { digest ?: string } ;
13+ reset : ( ) => void ;
1314} ) {
14- useEffect ( ( ) => {
15- posthog . captureException ( error ) ;
16- } , [ error ] ) ;
15+ useEffect ( ( ) => {
16+ posthog . captureException ( error ) ;
17+ } , [ error ] ) ;
1718
18- return (
19- < html lang = "en" >
20- < body >
21- < NextError statusCode = { 0 } />
22- < button type = "button" onClick = { reset } >
23- Try again
24- </ button >
25- </ body >
26- </ html >
27- ) ;
19+ return (
20+ < html lang = "en" >
21+ < body >
22+ < div className = "flex min-h-screen flex-col items-center justify-center gap-4 p-4" >
23+ < h2 className = "text-xl font-semibold" > Something went wrong</ h2 >
24+ < p className = "text-sm text-muted-foreground" >
25+ An unexpected error occurred.
26+ </ p >
27+ < Button onClick = { reset } > Try again</ Button >
28+ </ div >
29+ </ body >
30+ </ html >
31+ ) ;
2832}
You can’t perform that action at this time.
0 commit comments