import { WelcomeForm } from '@/components/modules/welcome-form';
import { getLocale, t } from '@/lib/i18n';
import { getWelcomeDashboard } from '@/lib/module-configs/welcome';

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

export default async function WelcomePage({ params }: WelcomePageProps) {
  const { guildId } = await params;
  const [locale, config] = await Promise.all([getLocale(), getWelcomeDashboard(guildId)]);

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