import { localizedMetadata } from "@/lib/i18n/serverMetadata";
import type { Metadata } from "next";

import LoginRoute from "@/features/auth/components/LoginRoute";

/*
 * Title only. `robots: { index: false, follow: false }` is already set once on
 * `(auth)/layout.tsx` for all eight routes in this group, and the description,
 * icons, openGraph and the `"%s | Fursa"` title template come from the root
 * layout — so this page inherits everything except a name of its own.
 *
 * This file used to be a Client Component, which cannot export `metadata` at
 * all, because it called `useSearchParams`. That call now lives in
 * `LoginRoute`, leaving this as the thin server shell the rest of `app/` uses.
 * Nothing about the rendered UI changed: the client child still holds the same
 * Suspense boundary and the same `returnTo` validation.
 */
const pageMetadata: Metadata = {
  title: "Sign in",
};

export async function generateMetadata(): Promise<Metadata> {
  return localizedMetadata(pageMetadata);
}

export default function LoginPage() {
  return <LoginRoute />;
}
