import { OrganizationLab } from "../../components/organization-lab";

type OrganizationsPageProps = {
  searchParams: Promise<{
    invitationId?: string | string[];
  }>;
};

export default async function OrganizationsPage({
  searchParams,
}: OrganizationsPageProps) {
  const params = await searchParams;
  const rawInvitationId = params.invitationId;
  const invitationId = Array.isArray(rawInvitationId)
    ? rawInvitationId[0]
    : rawInvitationId;

  return <OrganizationLab initialInvitationId={invitationId ?? null} />;
}
