import type { Metadata } from "next";
import NotFoundView from "@/views/not-found-view";
import { getLang, t } from "@/lib/seo/lang";

/**
 * للروابط غير الموجودة (رمز HTTP 404). الكيانات المحذوفة (برنامج/مدونة/خبر...)
 * تعرض NotFoundView نفسها من entity-route مع noindex.
 */
export async function generateMetadata(): Promise<Metadata> {
    const lang = await getLang();
    return {
        title: { absolute: `404 | ${t(lang, "ivory")}` },
        description: t(lang, "custom.no-data-page"),
        robots: { index: false, follow: true },
    };
}

/** يكافئ <Route path="*" element={<NotFound />} /> مع رمز HTTP 404 حقيقي */
export default function NotFound() {
    return <NotFoundView />;
}
