import { UsersManager } from '@/components/owner/owner-forms';
import { getLocale, t } from '@/lib/i18n';
import { prisma } from '@/lib/prisma';

export default async function OwnerUsersPage() {
  const [locale, users] = await Promise.all([
    getLocale(),
    prisma.globalUserBlacklist.findMany({ orderBy: { createdAt: 'desc' } })
  ]);

  return (
    <div className="space-y-6">
      <div>
        <h1 className="text-2xl font-semibold">{t(locale, 'owner.users.title')}</h1>
        <p className="text-sm text-muted-foreground">{t(locale, 'owner.users.subtitle')}</p>
      </div>
      <UsersManager initialUsers={users} />
    </div>
  );
}
