import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import Link from "next/link";

import { Button } from "@/components/ui/button";
import { createPageMetadata } from "@/lib/metadata";

export const metadata: Metadata = createPageMetadata({
  title: "Page Not Found",
  description: "The page you requested could not be found on FlatRender.",
  path: "/404",
});

export default async function NotFoundPage() {
  const t = await getTranslations("auto.appNotFound");

  return (
    <main className="flex min-h-screen flex-col items-center justify-center bg-white px-4 text-center">
      <h1 className="font-heading text-2xl font-bold text-neutral-900 sm:text-3xl">
        {t("title")}
      </h1>
      <p className="mt-3 max-w-md text-sm text-neutral-600 sm:text-base">
        {t("description")}
      </p>
      <Button asChild className="mt-8 bg-blue-600 hover:bg-blue-700">
        <Link href="/">{t("goHome")}</Link>
      </Button>
    </main>
  );
}
