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

export default async function OwnerFlagsPage() {
  const [locale, flags] = await Promise.all([
    getLocale(),
    prisma.featureFlag.findMany({ orderBy: { key: 'asc' } })
  ]);

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