File tree 2 files changed +54
-0
lines changed
2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ // NOTE: Must be client component. Them's the rules.
2
+ // https://nextjs.org/docs/app/building-your-application/routing/error-handling#using-error-boundaries
3
+ "use client" ;
4
+
5
+ import { Button } from "@/components/ui/button" ;
6
+ import Link from "next/link" ;
7
+ import { useEffect } from "react" ;
8
+
9
+ export default function Error ( {
10
+ error,
11
+ reset,
12
+ } : {
13
+ error : Error & { digest ?: string }
14
+ reset : ( ) => void
15
+ } ) {
16
+ useEffect ( ( ) => {
17
+ console . error ( error ) ;
18
+ } , [ error ] ) ;
19
+
20
+ return (
21
+ < div className = "bg-primary/60 py-8 rounded-lg border" >
22
+ < div className = "flex flex-col gap-8 items-center" >
23
+ < h1 className = "text-lg font-medium sm:w-11/12 w-full" > An error has occurred.</ h1 >
24
+ < p className = "text-sm sm:w-11/12 w-full" > Apologies, but something happened with Cuiloa and the client couldn't recover.</ p >
25
+ < div className = "flex sm:w-11/12 w-full gap-8" >
26
+ < Button className = "w-fit" asChild >
27
+ < Link href = { "/" } > Home</ Link >
28
+ </ Button >
29
+ < Button className = "w-fit" onClick = { ( ) => reset ( ) } >
30
+ Try Reloading
31
+ </ Button >
32
+ </ div >
33
+ </ div >
34
+ </ div >
35
+ ) ;
36
+ }
Original file line number Diff line number Diff line change
1
+ import { Button } from "@/components/ui/button" ;
2
+ import Link from "next/link" ;
3
+
4
+ export default function NotFound ( ) {
5
+ return (
6
+ < div className = "bg-primary/60 py-8 rounded-lg border" >
7
+ < div className = "flex flex-col gap-8 items-center" >
8
+ < h1 className = "text-lg font-medium sm:w-11/12 w-full" > Page not found!</ h1 >
9
+ < p className = "text-sm sm:w-11/12 w-full" > Apologies, but Cuiloa could not find the page you requested.</ p >
10
+ < div className = "flex sm:w-11/12 w-full gap-8" >
11
+ < Button className = "w-fit" asChild >
12
+ < Link href = { "/" } > Go Home</ Link >
13
+ </ Button >
14
+ </ div >
15
+ </ div >
16
+ </ div >
17
+ ) ;
18
+ }
You can’t perform that action at this time.
0 commit comments