import { LevelingForm } from '@/components/modules/leveling-form';
import { getLocale, t } from '@/lib/i18n';
import { getLevelingDashboard } from '@/lib/module-configs/leveling';

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

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

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