import { FeedsManager } from '@/components/modules/feeds-manager';
import { getLocale, t } from '@/lib/i18n';
import { listFeeds } from '@/lib/module-configs/feeds';

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

export default async function FeedsPage({ params }: FeedsPageProps) {
  const { guildId } = await params;
  const [locale, feeds] = await Promise.all([getLocale(), listFeeds(guildId)]);

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