22 lines
646 B
TypeScript
22 lines
646 B
TypeScript
import type { Route } from "./+types/$";
|
|
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 CatchAllRoute() {
|
|
const { isAuthenticated, token } = useAuth();
|
|
|
|
// Show different 404 pages based on authentication status
|
|
if (isAuthenticated && token?.accessToken) {
|
|
return <AuthenticatedNotFound />;
|
|
}
|
|
|
|
return <PublicNotFound />;
|
|
}
|