import { FunForm } from '@/components/modules/fun-form';
import { getLocale, t } from '@/lib/i18n';
import { getFunDashboard } from '@/lib/module-configs/fun';

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

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

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