1+ "use client" ;
2+
3+ import Link from "next/link" ;
4+ import { Button } from "@/components/ui/button" ;
5+ import { useState , useEffect } from "react" ;
6+
7+ export default function NotFound ( ) {
8+ const [ tagLine , setTagLine ] = useState ( 0 ) ;
9+
10+ const funnyTaglines = [
11+ "Looks like this tag is missing from our database!" ,
12+ "This tag seems to have wandered off..." ,
13+ "Oops! This tag is playing hide and seek." ,
14+ "Error 404: Tag not found in the wild!" ,
15+ "Houston, we have a problem. This tag is lost in space." ,
16+ "This tag has gone on vacation without telling us." ,
17+ ] ;
18+
19+ useEffect ( ( ) => {
20+ const tagInterval = setInterval ( ( ) => {
21+ setTagLine ( prev => ( prev + 1 ) % funnyTaglines . length ) ;
22+ } , 4000 ) ;
23+
24+ return ( ) => {
25+ clearInterval ( tagInterval ) ;
26+ } ;
27+ } , [ ] ) ;
28+
29+ return (
30+ < div className = "min-h-[80vh] flex flex-col items-center justify-center text-center px-4" >
31+ < div className = "relative mb-8" >
32+ < h1 className = "text-9xl font-bold" >
33+ 404
34+ </ h1 >
35+ </ div >
36+ < h2 className = "text-3xl md:text-4xl font-bold mb-4" > Page Not Found</ h2 >
37+
38+ < p className = "text-xl mb-8 max-w-md min-h-[60px] transition-all duration-500" >
39+ { funnyTaglines [ tagLine ] }
40+ </ p >
41+
42+ < div className = "flex flex-col sm:flex-row gap-4" >
43+ < Button asChild size = "lg" >
44+ < Link href = "/" >
45+ Take Me Home
46+ </ Link >
47+ </ Button >
48+
49+ < Button variant = "outline" asChild size = "lg" >
50+ < Link href = "/lookup" >
51+ Look Up a Tag
52+ </ Link >
53+ </ Button >
54+ </ div >
55+ </ div >
56+ ) ;
57+ }
0 commit comments