import { EconomyForm } from '@/components/modules/economy-form';
import { getLocale, t } from '@/lib/i18n';
import { getEconomyDashboard } from '@/lib/module-configs/economy';

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

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

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