import type { Metadata } from "next";
import { VerifyEmail } from "@/components/hub/AuthForms";
import { HubShell } from "@/components/hub/HubShell";
import { pageMetadata } from "@/lib/seo";

/* Depends on the visitor's session: never prerendered or cached. */
export const dynamic = "force-dynamic";

export const metadata: Metadata = pageMetadata({
  title: "Confirm Your Email | Monetize Hub",
  description: "Confirm the email for your Monetize Hub account.",
  path: "/hub-verify",
  noindex: true,
});

/* Opened from the confirmation email: /hub-verify?token=… */
export default async function HubVerifyPage({ searchParams }: { searchParams: Promise<{ token?: string }> }) {
  const token = (await searchParams).token ?? "";
  return (
    <HubShell eyebrow="Monetize Hub" title="Confirm your" accent="email" lede="One moment while we confirm your email and sign you in.">
      <h2>Confirming your email</h2>
      <VerifyEmail token={token} />
    </HubShell>
  );
}
