import { AuthCard } from '@/components/AuthCard';
import { VerifyForm } from '@/components/AccountForms';

export const metadata = { title: 'Confirm your email' };

/** A button, not automatic: mail scanners open links and shouldn't confirm accounts */
export default async function Verify({ searchParams }: { searchParams: Promise<{ token?: string }> }) {
  const { token = '' } = await searchParams;
  return (
    <AuthCard title="Confirm your email" intro={token ? 'One click and you’re done.' : undefined}>
      {token ? <VerifyForm token={token} /> : <p className="text-sm text-danger">This link is incomplete. Open it again from the email.</p>}
    </AuthCard>
  );
}
