import { GuildsManager } from '@/components/owner/owner-forms'; import { getLocale, t } from '@/lib/i18n'; import { enrichOwnerGuildListItems } from '@/lib/owner-guilds'; import { prisma } from '@/lib/prisma'; export default async function OwnerGuildsPage() { const locale = await getLocale(); const [guilds, blacklist] = await Promise.all([ prisma.guild.findMany({ include: { settings: true }, orderBy: { createdAt: 'desc' }, take: 200 }), prisma.guildBlacklist.findMany() ]); const blacklisted = new Set(blacklist.map((entry) => entry.guildId)); const initialGuilds = await enrichOwnerGuildListItems( guilds.map((guild) => ({ id: guild.id, locale: guild.settings?.locale ?? 'de', createdAt: guild.createdAt.toISOString(), blacklisted: blacklisted.has(guild.id) })) ); return (
{t(locale, 'owner.guilds.subtitle')}