import { TagsManager } from '@/components/modules/tags-manager';
import { getLocale, t } from '@/lib/i18n';
import { listTags } from '@/lib/module-configs/tags';

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

export default async function TagsPage({ params }: TagsPageProps) {
  const { guildId } = await params;
  const [locale, tags] = await Promise.all([getLocale(), listTags(guildId)]);

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