File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change 1- 'use client' // Error components must be Client components
1+ 'use client'
22
33import { Button } from '@/components/common/Button'
44import { HeroPattern } from '@/components/common/HeroPattern'
55import { useEffect } from 'react'
6+ import OnboardingNavbar from '@/components/layout/OnboardingNavbar'
67
78export default function Error ( { error, reset } : { error : Error ; reset : ( ) => void } ) {
89 useEffect ( ( ) => {
9- // Log the error to an error reporting service
1010 console . error ( error )
1111 } , [ error ] )
1212
1313 return (
14- < div className = "w-full h-screen flex flex-col gap-4 justify-center items-center " >
14+ < main className = "w-full h-screen" role = "alert" aria-live = "assertive ">
1515 < HeroPattern />
16- < h2 > Something went wrong!</ h2 >
17- < Button
18- variant = "primary"
19- onClick = {
20- // Attempt to recover by trying to re-render the segment
21- ( ) => reset ( )
22- }
23- >
24- Try again
25- </ Button >
26- </ div >
16+ < OnboardingNavbar />
17+ < div className = "flex flex-col gap-4 justify-center items-center w-full h-full" >
18+ < div className = "text-center max-w-md px-4" >
19+ < h2 className = "text-zinc-900 dark:text-zinc-100 font-semibold text-lg" >
20+ Something went wrong!
21+ </ h2 >
22+ < p className = "text-zinc-500 dark:text-zinc-400 font-mono text-sm mt-2" >
23+ { error . name } : { error . message || 'An unexpected error occurred' }
24+ </ p >
25+ </ div >
26+ < Button variant = "primary" onClick = { ( ) => reset ( ) } >
27+ Try again
28+ </ Button >
29+ </ div >
30+ </ main >
2731 )
2832}
You can’t perform that action at this time.
0 commit comments