import { redirect } from "next/navigation";
import { getSessionUser } from "@/lib/server/session";
import GroupSettingsContent from "@/components/group-settings-content";

export default async function GroupSettingsPage({ params }: { params: Promise<{ id: string }> }) {
    const user = await getSessionUser();
    if (!user) redirect("/login");

    const { id } = await params;
    const groupId = Number(id || 0);
    if (!groupId) redirect("/");

    return <GroupSettingsContent groupId={groupId} />;
}
