import type { Route } from "./+types/404";
import { AuthenticatedNotFound, PublicNotFound } from "~/components/common/not-found";
import { useAuth } from "~/contexts/auth-context";

export function meta({}: Route.MetaArgs) {
  return [
    { title: "صفحه یافت نشد - 404" },
    { name: "description", content: "صفحه مورد نظر یافت نشد" },
  ];
}

export default function NotFoundPage() {
  const { isAuthenticated, token } = useAuth();

  // Show different 404 pages based on authentication status
  if (isAuthenticated && token?.accessToken) {
    return <AuthenticatedNotFound />;
  }

  return <PublicNotFound />;
}
