import { StatsForm } from '@/components/modules/stats-form';
import { getLocale, t } from '@/lib/i18n';
import { getStatsDashboard } from '@/lib/module-configs/stats';

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

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

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