import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { GroupsTable } from "@/components/groups/groups-table";

export const metadata = {
  title: "NEAH - Groupes",
};

export default async function GroupsPage() {
  const session = await getServerSession(authOptions);

  if (!session) {
    redirect("/signin");
  }

  return (
    <div className='min-h-screen bg-black'>
      <div className='container mx-auto py-10'>
        <GroupsTable userRole={session.user.role || []} />
      </div>
    </div>
  );
} 