| import { useLocation, useNavigate } from "react-router-dom"; | |
| import { useEffect } from "react"; | |
| import { Button } from "@/components/ui/button"; | |
| const NotFound = () => { | |
| const location = useLocation(); | |
| const navigate = useNavigate(); | |
| useEffect(() => { | |
| console.error( | |
| "404 Error: User attempted to access non-existent route:", | |
| location.pathname | |
| ); | |
| }, [location.pathname]); | |
| return ( | |
| <div className="min-h-screen flex flex-col items-center justify-center p-4 animate-fade-in"> | |
| <div className="text-center max-w-md w-full p-8 rounded-xl border border-border bg-card card-shadow"> | |
| <h1 className="text-5xl font-bold mb-4 text-primary">404</h1> | |
| <p className="text-xl mb-6">Page not found</p> | |
| <p className="text-muted-foreground mb-8"> | |
| The page you are looking for doesn't exist or has been moved. | |
| </p> | |
| <Button | |
| onClick={() => navigate("/")} | |
| className="w-full py-6" | |
| > | |
| Back to Home | |
| </Button> | |
| </div> | |
| </div> | |
| ); | |
| }; | |
| export default NotFound; | |