import type { Metadata } from "next";
import { ResetPasswordForm } from "./components/ResetPasswordForm";
import { Footer } from "../../components/Footer";

export const metadata: Metadata = {
  title: "Passwort zurücksetzen",
  description: "Vergib ein neues Passwort für dein einfach produktiv-Konto.",
  robots: { index: false, follow: true },
};

// token read server-side from searchParams (not the client-side
// useSearchParams() hook) — avoids needing a Suspense boundary here, same
// reasoning as /konto/profil's ?verified= handling.
export default async function PasswortZuruecksetzenPage({
  searchParams,
}: {
  searchParams: Promise<{ token?: string }>;
}) {
  const { token } = await searchParams;

  return (
    <>
      <main className="flex flex-col flex-1 bg-bg-base">
        <ResetPasswordForm token={token ?? null} />
      </main>
      <Footer />
    </>
  );
}
