import type { Metadata } from 'next';
import { PreferencesForm } from './PreferencesForm';

export const metadata: Metadata = {
  title: 'Your alerts',
  robots: { index: false, follow: false },
};

/**
 * Manage what you receive.
 *
 * Reached from the footer of every email. Interactive, so the form
 * itself is a client component; this page only passes the token through.
 */
export default async function PreferencesPage({
  searchParams,
}: {
  searchParams: Promise<{ t?: string }>;
}) {
  const { t } = await searchParams;
  return <PreferencesForm token={t ?? null} />;
}
