import React from 'react';
import { prisma } from '@/app/lib/prisma';
import CategoryManager from './CategoryManager';

export const dynamic = 'force-dynamic';

export default async function AdminCategoriesPage() {
  const categories = await prisma.category.findMany({
    include: {
      _count: {
        select: { items: true }
      }
    },
    orderBy: { createdAt: 'asc' }
  });

  return <CategoryManager categories={categories} />;
}
