import { LoggingForm } from '@/components/modules/logging-form';
import { getLocale, t } from '@/lib/i18n';
import { getLoggingDashboard } from '@/lib/module-configs/logging';

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

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

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