import { useEffect } from "react";
import { Link, useLocation } from "react-router-dom";

export default function NotFound() {
  const location = useLocation();

  useEffect(() => {
    console.error(
      "404 Error: User attempted to access non-existent fechamento route:",
      location.pathname,
    );
  }, [location.pathname]);

  return (
    <div className="flex min-h-[70vh] items-center justify-center">
      <div className="text-center">
        <h1 className="mb-3 text-4xl font-bold">404</h1>
        <p className="mb-4 text-muted-foreground">Rota não encontrada neste módulo.</p>
        <Link to="/intelligence-score" className="text-primary underline hover:text-primary/90">
          Voltar para Fechamentos
        </Link>
      </div>
    </div>
  );
}
