import { AuthShell, InvalidLink } from '@/components/AuthShell';
import { VerifyEmailForm } from '@/components/AccountForms';

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

export default async function VerifyEmail({ searchParams }: { searchParams: Promise<{ token?: string }> }) {
  const { token = '' } = await searchParams;
  return (
    <AuthShell title="Confirm your email address" description={token ? 'One click and you’re done.' : undefined} backToLogin={false}>
      {token ? <VerifyEmailForm token={token} /> : <InvalidLink what="confirmation" />}
    </AuthShell>
  );
}
