import { getServerSession } from "next-auth/next";
import { authOptions } from "@/app/api/auth/options";
import { redirect } from "next/navigation";
import { AnnouncementsPage } from "@/components/announcement/announcements-page";

export const metadata = {
  title: "Announcements",
};

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

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

  // Get user role(s)
  const userRole = session.user.role || [];

  return (
    <div className='min-h-screen bg-white'>
      <div className='container mx-auto py-10'>
        <AnnouncementsPage userRole={userRole} />
      </div>
    </div>
  );
} 