|
|
| 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]); |
|
|
| const handleReturnHome = () => { |
| navigate("/"); |
| }; |
|
|
| return ( |
| <div className="min-h-screen flex items-center justify-center bg-gray-100 dark:bg-factory-blue-dark"> |
| <div className="text-center"> |
| <h1 className="text-4xl font-bold mb-4 dark:text-white">404</h1> |
| <p className="text-xl text-gray-600 dark:text-gray-300 mb-4">Oops! Page not found</p> |
| <Button |
| onClick={handleReturnHome} |
| variant="default" |
| className="text-white hover:text-white" |
| > |
| Return to Home |
| </Button> |
| </div> |
| </div> |
| ); |
| }; |
|
|
| export default NotFound; |
|
|