import { VerificationForm } from '@/components/modules/verification-form';
import { getLocale, t } from '@/lib/i18n';
import { getVerificationDashboard } from '@/lib/module-configs/verification';

interface VerificationPageProps {
  params: Promise<{ guildId: string }>;
}

export default async function VerificationPage({ params }: VerificationPageProps) {
  const { guildId } = await params;
  const [locale, payload] = await Promise.all([getLocale(), getVerificationDashboard(guildId)]);

  return (
    <div className="space-y-6">
      <div>
        <h1 className="text-2xl font-semibold">{t(locale, 'modules.verification.label')}</h1>
        <p className="text-sm text-muted-foreground">{t(locale, 'modules.verification.description')}</p>
      </div>
      <VerificationForm
        guildId={guildId}
        initialValue={payload.config}
        availableCaptchaProviders={payload.availableCaptchaProviders}
      />
    </div>
  );
}
