Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: Enable invite team members on trial

Ashish Viradiyaaaa0888afd19
diff --git a/components/layouts/app.tsx b/components/layouts/app.tsx
index 2fc5bbdd..2825351b 100644
--- a/components/layouts/app.tsx
+++ b/components/layouts/app.tsx
@@ -3,6 +3,7 @@ import { AppSidebar } from "@/components/sidebar/app-sidebar";
import { Separator } from "../ui/separator";
import { SidebarInset, SidebarTrigger } from "../ui/sidebar";
import { SidebarProvider } from "../ui/sidebar";
+import { BlockingModal } from "./blocking-modal";
import { AppBreadcrumb } from "./breadcrumb";
import TrialBanner from "./trial-banner";
@@ -21,6 +22,7 @@ export default function AppLayout({ children }: { children: React.ReactNode }) {
</header>
{/* Trial banner shown only on trial */}
<TrialBanner />
+ <BlockingModal />
<main className="flex-1">{children}</main>
</SidebarInset>
</div>
diff --git a/components/layouts/blocking-modal.tsx b/components/layouts/blocking-modal.tsx
new file mode 100644
index 00000000..3e800569
--- /dev/null
+++ b/components/layouts/blocking-modal.tsx
@@ -0,0 +1,194 @@
+import React, { useEffect, useState } from "react";
+
+import { initialState } from "@/context/team-context";
+import { useTeam } from "@/context/team-context";
+import { TeamContextType } from "@/context/team-context";
+import { PlanEnum } from "@/ee/stripe/constants";
+import { InfoIcon, ShieldAlertIcon } from "lucide-react";
+import { useSession } from "next-auth/react";
+
+import { usePlan } from "@/lib/swr/use-billing";
+import { useGetTeam } from "@/lib/swr/use-team";
+import { useTeams } from "@/lib/swr/use-teams";
+import { CustomUser } from "@/lib/types";
+
+import {
+ AlertDialog,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "@/components/ui/alert-dialog";
+
+import { UpgradePlanModal } from "../billing/upgrade-plan-modal";
+import { AddTeamModal } from "../teams/add-team-modal";
+import { Button } from "../ui/button";
+
+export const BlockingModal = () => {
+ const { isFree, isTrial } = usePlan();
+ const { data: session } = useSession();
+ const { team } = useGetTeam()!;
+ const { setCurrentTeam }: TeamContextType = useTeam() || initialState;
+ const { teams } = useTeams();
+
+ const currentUserId = (session?.user as CustomUser)?.id;
+ const isAdmin = team?.users.some(
+ (user) => user.userId === currentUserId && user.role === "ADMIN",
+ );
+
+ const userTeam = teams?.find((t) => t.id !== team?.id);
+ const multipleUsers = team?.users?.length && team?.users?.length > 1;
+
+ const shouldShowBanner = isFree && !isTrial && isAdmin && multipleUsers;
+ const [showModal, setShowModal] = useState(false);
+
+ const shouldShowModal =
+ isFree && !isTrial && !isAdmin && multipleUsers && showModal;
+
+ useEffect(() => {
+ if (isFree && !isTrial && !isAdmin && multipleUsers) {
+ setShowModal(true);
+ }
+ }, [isFree, isTrial, isAdmin, multipleUsers]);
+
+ useEffect(() => {
+ if (shouldShowModal) {
+ const preventRightClick = (e: MouseEvent) => {
+ e.preventDefault();
+ return false;
+ };
+
+ const preventKeyboardShortcuts = (e: KeyboardEvent) => {
+ if (e.key === "F12") {
+ e.preventDefault();
+ return false;
+ }
+ if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key === "I") {
+ e.preventDefault();
+ return false;
+ }
+ if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key === "C") {
+ e.preventDefault();
+ return false;
+ }
+ if ((e.ctrlKey || e.metaKey) && e.shiftKey && e.key === "J") {
+ e.preventDefault();
+ return false;
+ }
+ if (e.key === "ContextMenu") {
+ e.preventDefault();
+ return false;
+ }
+ };
+
+ document.addEventListener("contextmenu", preventRightClick);
+ document.addEventListener("keydown", preventKeyboardShortcuts);
+
+ return () => {
+ document.removeEventListener("contextmenu", preventRightClick);
+ document.removeEventListener("keydown", preventKeyboardShortcuts);
+ };
+ }
+ }, [shouldShowModal]);
+
+ const handleSwitchTeam = () => {
+ if (userTeam) {
+ localStorage.setItem("currentTeamId", userTeam.id);
+ setCurrentTeam(userTeam);
+ setShowModal(false);
+ }
+ };
+
+ return (
+ <>
+ <div className="flex w-full px-4">
+ {shouldShowBanner && (
+ <div className="flex w-full items-center gap-3 rounded-md border border-yellow-200 bg-yellow-50 p-4 text-sm dark:border-yellow-800 dark:bg-yellow-900/50 dark:text-yellow-100">
+ <div className="flex-shrink-0">
+ <InfoIcon className="h-5 w-5 text-yellow-600 dark:text-yellow-400" />
+ </div>
+ <div className="flex-1">
+ <p className="font-medium">
+ You&apos;re now on the free solo plan
+ </p>
+ <p className="mt-1 text-yellow-700 dark:text-yellow-200">
+ To continue collaborating with your team, please upgrade your
+ plan.
+ </p>
+ </div>
+ <UpgradePlanModal
+ clickedPlan={PlanEnum.DataRooms}
+ trigger="trial_end_blocking_modal"
+ >
+ <Button type="button" variant="orange">
+ Upgrade
+ </Button>
+ </UpgradePlanModal>
+ </div>
+ )}
+ </div>
+ <AlertDialog open={!!shouldShowModal} onOpenChange={setShowModal}>
+ <AlertDialogContent
+ className="w-full max-w-md"
+ onContextMenu={(e) => e.preventDefault()}
+ >
+ <AlertDialogHeader className="flex flex-col items-center text-center">
+ <div className="mb-4 rounded-full bg-red-100/80 p-4 dark:bg-red-900/30">
+ <ShieldAlertIcon className="h-10 w-10 text-red-500 dark:text-red-400" />
+ </div>
+ <AlertDialogTitle className="text-2xl font-semibold">
+ Account Access Limited
+ </AlertDialogTitle>
+ <AlertDialogDescription className="mt-2 text-muted-foreground">
+ Your team is now on a free solo plan. You no longer have access to
+ this workspace.
+ </AlertDialogDescription>
+ <AlertDialogDescription className="my-2 text-muted-foreground">
+ {userTeam ? (
+ <>
+ Switch to{" "}
+ <Button
+ variant="link"
+ className="p-0 font-bold text-primary"
+ onClick={handleSwitchTeam}
+ >
+ {userTeam.name}
+ </Button>{" "}
+ to continue using the platform.
+ </>
+ ) : (
+ "Create a new team to continue using the platform."
+ )}
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <UpgradePlanModal
+ clickedPlan={PlanEnum.DataRooms}
+ trigger="trial_end_blocking_modal_for_team_member"
+ >
+ <Button
+ className="w-full sm:w-auto"
+ variant="outline"
+ type="button"
+ >
+ Upgrade
+ </Button>
+ </UpgradePlanModal>
+ {userTeam ? (
+ <Button className="w-full sm:w-auto" onClick={handleSwitchTeam}>
+ Switch to &quot;{userTeam.name}&quot;
+ </Button>
+ ) : (
+ <AddTeamModal setCurrentTeam={setCurrentTeam}>
+ <Button className="w-full sm:w-auto">Create New Team</Button>
+ </AddTeamModal>
+ )}
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ </>
+ );
+};
+
+export default BlockingModal;
diff --git a/components/sidebar/team-switcher.tsx b/components/sidebar/team-switcher.tsx
index 590de579..e67b9b0d 100644
--- a/components/sidebar/team-switcher.tsx
+++ b/components/sidebar/team-switcher.tsx
@@ -5,12 +5,15 @@ import * as React from "react";
import { useLimits } from "@/ee/limits/swr-handler";
import { PlanEnum } from "@/ee/stripe/constants";
import { ChevronsUpDown, UserRoundPlusIcon } from "lucide-react";
+import { Team } from "@/lib/types";
+import { cn } from "@/lib/utils";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
+ DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import {
@@ -20,9 +23,6 @@ import {
useSidebar,
} from "@/components/ui/sidebar";
-import { Team } from "@/lib/types";
-import { cn } from "@/lib/utils";
-
import { AddSeatModal } from "../billing/add-seat-modal";
import { UpgradePlanModal } from "../billing/upgrade-plan-modal";
import { AddTeamMembers } from "../teams/add-team-member-modal";
@@ -42,7 +42,7 @@ export function TeamSwitcher({
const [isAddSeatModalOpen, setAddSeatModalOpen] =
React.useState<boolean>(false);
const { isMobile } = useSidebar();
- const { canAddUsers } = useLimits();
+ const { canAddUsers, showUpgradePlanModal } = useLimits();
const switchTeam = (team: Team) => {
localStorage.setItem("currentTeamId", team.id);
@@ -53,7 +53,7 @@ export function TeamSwitcher({
return (
<SidebarMenu className="flex flex-row items-center gap-1 group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:gap-1.5">
- <SidebarMenuItem>
+ <SidebarMenuItem className="w-full">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<SidebarMenuButton
@@ -80,6 +80,7 @@ export function TeamSwitcher({
<DropdownMenuLabel className="text-xs text-muted-foreground">
Teams
</DropdownMenuLabel>
+ <DropdownMenuSeparator />
{teams.map((team, index) => (
<DropdownMenuItem
key={index}
@@ -112,7 +113,7 @@ export function TeamSwitcher({
</DropdownMenu>
</SidebarMenuItem>
<SidebarMenuItem>
- {activeTeam.plan?.includes("free") ? (
+ {showUpgradePlanModal ? (
<UpgradePlanModal
clickedPlan={PlanEnum.Pro}
trigger={"invite_team_members"}
diff --git a/components/teams/add-team-member-modal.tsx b/components/teams/add-team-member-modal.tsx
index b0fc8456..1757b91c 100644
--- a/components/teams/add-team-member-modal.tsx
+++ b/components/teams/add-team-member-modal.tsx
@@ -76,6 +76,7 @@ export function AddTeamMembers({
});
mutate(`/api/teams/${teamId}/invitations`);
+ mutate(`/api/teams/${teamId}/limits`);
toast.success("An invitation email has been sent!");
setOpen(false);
diff --git a/components/teams/add-team-modal.tsx b/components/teams/add-team-modal.tsx
index 2efb7c9c..485bb55f 100644
--- a/components/teams/add-team-modal.tsx
+++ b/components/teams/add-team-modal.tsx
@@ -4,6 +4,9 @@ import { useState } from "react";
import { usePlausible } from "next-plausible";
import { toast } from "sonner";
+import { mutate } from "swr";
+
+import { Team } from "@/lib/types";
import { Button } from "@/components/ui/button";
import {
@@ -18,7 +21,12 @@ import {
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
-export function AddTeamModal({ children }: { children: React.ReactNode }) {
+interface AddTeamModalProps {
+ children: React.ReactNode;
+ setCurrentTeam: (team: Team) => void;
+}
+
+export function AddTeamModal({ children, setCurrentTeam }: AddTeamModalProps) {
const router = useRouter();
const plausible = usePlausible();
const [teamName, setTeamName] = useState<string>("");
@@ -47,7 +55,10 @@ export function AddTeamModal({ children }: { children: React.ReactNode }) {
toast.error(error);
return;
}
-
+ const data = await response.json();
+ mutate("/api/teams");
+ localStorage.setItem("currentTeamId", data.id);
+ setCurrentTeam(data);
toast.success("Team created successfully!");
router.push("/documents");
setLoading(false);
diff --git a/components/ui/alert-dialog.tsx b/components/ui/alert-dialog.tsx
new file mode 100644
index 00000000..cfc54c49
--- /dev/null
+++ b/components/ui/alert-dialog.tsx
@@ -0,0 +1,143 @@
+"use client";
+
+import * as React from "react";
+
+import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
+
+import { cn } from "@/lib/utils";
+
+import { buttonVariants } from "@/components/ui/button";
+
+const AlertDialog = AlertDialogPrimitive.Root;
+
+const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
+
+const AlertDialogPortal = AlertDialogPrimitive.Portal;
+
+const AlertDialogOverlay = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Overlay
+ className={cn(
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
+ className,
+ )}
+ {...props}
+ ref={ref}
+ />
+));
+AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
+
+const AlertDialogContent = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Content>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPortal>
+ <AlertDialogOverlay />
+ <AlertDialogPrimitive.Content
+ ref={ref}
+ className={cn(
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
+ className,
+ )}
+ {...props}
+ />
+ </AlertDialogPortal>
+));
+AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
+
+const AlertDialogHeader = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col space-y-2 text-center sm:text-left",
+ className,
+ )}
+ {...props}
+ />
+);
+AlertDialogHeader.displayName = "AlertDialogHeader";
+
+const AlertDialogFooter = ({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) => (
+ <div
+ className={cn(
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
+ className,
+ )}
+ {...props}
+ />
+);
+AlertDialogFooter.displayName = "AlertDialogFooter";
+
+const AlertDialogTitle = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Title>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Title
+ ref={ref}
+ className={cn("text-lg font-semibold", className)}
+ {...props}
+ />
+));
+AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
+
+const AlertDialogDescription = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Description>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Description
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+));
+AlertDialogDescription.displayName =
+ AlertDialogPrimitive.Description.displayName;
+
+const AlertDialogAction = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Action>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Action
+ ref={ref}
+ className={cn(buttonVariants(), className)}
+ {...props}
+ />
+));
+AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
+
+const AlertDialogCancel = React.forwardRef<
+ React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
+ React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
+>(({ className, ...props }, ref) => (
+ <AlertDialogPrimitive.Cancel
+ ref={ref}
+ className={cn(
+ buttonVariants({ variant: "outline" }),
+ "mt-2 sm:mt-0",
+ className,
+ )}
+ {...props}
+ />
+));
+AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
+
+export {
+ AlertDialog,
+ AlertDialogPortal,
+ AlertDialogOverlay,
+ AlertDialogTrigger,
+ AlertDialogContent,
+ AlertDialogHeader,
+ AlertDialogFooter,
+ AlertDialogTitle,
+ AlertDialogDescription,
+ AlertDialogAction,
+ AlertDialogCancel,
+};
diff --git a/ee/limits/server.ts b/ee/limits/server.ts
index 13f89f20..64abff5a 100644
--- a/ee/limits/server.ts
+++ b/ee/limits/server.ts
@@ -13,6 +13,7 @@ import {
// Function to determine if a plan is free or free+drtrial
const isFreePlan = (plan: string) => plan === "free" || plan === "free+drtrial";
+const isTrialPlan = (plan: string) => plan.includes("drtrial");
// Function to get the base plan from a plan string
const getBasePlan = (plan: string) => plan.split("+")[0];
@@ -99,6 +100,7 @@ export async function getLimits({
let parsedData = configSchema.parse(team.limits);
const basePlan = getBasePlan(team.plan);
+ const isTrial = isTrialPlan(team.plan);
const defaultLimits = planLimitsMap[basePlan];
// Adjust limits based on the plan if they're at the default value
@@ -107,6 +109,9 @@ export async function getLimits({
...defaultLimits,
...parsedData,
usage: { documents: documentCount, links: linkCount, users: userCount },
+ ...(isTrial && {
+ users: 3,
+ }),
};
} else {
return {
@@ -122,12 +127,15 @@ export async function getLimits({
} catch (error) {
// if no limits set or parsing fails, return default limits based on the plan
const basePlan = getBasePlan(team.plan);
+ const isTrial = isTrialPlan(team.plan);
const defaultLimits = planLimitsMap[basePlan] || FREE_PLAN_LIMITS;
-
return {
...defaultLimits,
conversationsInDataroom: false,
usage: { documents: documentCount, links: linkCount, users: userCount },
+ ...(isTrial && {
+ users: 3,
+ }),
};
}
}
diff --git a/ee/limits/swr-handler.ts b/ee/limits/swr-handler.ts
index a574c65f..21e886dc 100644
--- a/ee/limits/swr-handler.ts
+++ b/ee/limits/swr-handler.ts
@@ -5,6 +5,7 @@ import { z } from "zod";
import { fetcher } from "@/lib/utils";
import { configSchema } from "./server";
+import { usePlan } from "@/lib/swr/use-billing";
export type LimitProps = z.infer<typeof configSchema> & {
usage: {
@@ -17,6 +18,7 @@ export type LimitProps = z.infer<typeof configSchema> & {
export function useLimits() {
const teamInfo = useTeam();
+ const { isFree, isTrial } = usePlan();
const teamId = teamInfo?.currentTeam?.id;
const { data, error } = useSWR<LimitProps | null>(
@@ -32,8 +34,10 @@ export function useLimits() {
: true;
const canAddLinks = data?.links ? data?.usage?.links < data?.links : true;
const canAddUsers = data?.users ? data?.usage?.users < data?.users : true;
+ const showUpgradePlanModal = (isFree && !isTrial) || (isTrial && !canAddUsers);
return {
+ showUpgradePlanModal,
limits: data,
canAddDocuments,
canAddLinks,
diff --git a/package.json b/package.json
index 111a33e4..eb2d0ab0 100644
--- a/package.json
+++ b/package.json
@@ -35,6 +35,7 @@
"@pdf-lib/fontkit": "^1.1.1",
"@prisma/client": "^6.5.0",
"@radix-ui/react-accordion": "^1.2.4",
+ "@radix-ui/react-alert-dialog": "^1.1.11",
"@radix-ui/react-avatar": "^1.1.4",
"@radix-ui/react-checkbox": "^1.1.5",
"@radix-ui/react-collapsible": "^1.1.4",
diff --git a/pages/settings/people.tsx b/pages/settings/people.tsx
index 0aeff9ef..85552504 100644
--- a/pages/settings/people.tsx
+++ b/pages/settings/people.tsx
@@ -5,7 +5,6 @@ import { useState } from "react";
import { useTeam } from "@/context/team-context";
import { PlanEnum } from "@/ee/stripe/constants";
-import { getPriceIdFromPlan } from "@/ee/stripe/functions/get-price-id-from-plan";
import { useSession } from "next-auth/react";
import { toast } from "sonner";
import { mutate } from "swr";
@@ -44,8 +43,7 @@ export default function Billing() {
const { data: session } = useSession();
const { team, loading } = useGetTeam()!;
const teamInfo = useTeam();
- const { plan: userPlan, planName } = usePlan();
- const { limits } = useLimits();
+ const { canAddUsers, showUpgradePlanModal } = useLimits();
const { teams } = useTeams();
const analytics = useAnalytics();
@@ -53,9 +51,6 @@ export default function Billing() {
const router = useRouter();
- const numUsers = (team && team.users.length) ?? 1;
- const numInvitations = (invitations && invitations.length) ?? 0;
-
const getUserDocumentCount = (userId: string) => {
const documents = team?.documents.filter(
(document) => document.owner?.id === userId,
@@ -129,6 +124,8 @@ export default function Billing() {
await mutate(`/api/teams/${teamInfo?.currentTeam?.id}`);
await mutate("/api/teams");
+ mutate(`/api/teams/${teamInfo?.currentTeam?.id}/invitations`);
+ mutate(`/api/teams/${teamInfo?.currentTeam?.id}/limits`);
setLeavingUserId("");
if (isCurrentUser(userId)) {
@@ -171,6 +168,8 @@ export default function Billing() {
email: invitation.email as string,
teamId: teamInfo?.currentTeam?.id,
});
+ mutate(`/api/teams/${teamInfo?.currentTeam?.id}/invitations`);
+ mutate(`/api/teams/${teamInfo?.currentTeam?.id}/limits`);
toast.success("Invitation resent successfully!");
};
@@ -202,9 +201,11 @@ export default function Billing() {
});
mutate(`/api/teams/${teamInfo?.currentTeam?.id}/invitations`);
+ mutate(`/api/teams/${teamInfo?.currentTeam?.id}/limits`);
toast.success("Invitation revoked successfully!");
};
+ const showInvite = canAddUsers;
return (
<AppLayout>
@@ -229,7 +230,7 @@ export default function Billing() {
Teammates that have access to this project.
</p>
</div>
- {userPlan === "free" ? (
+ {showUpgradePlanModal ? (
<UpgradePlanModal
clickedPlan={PlanEnum.Pro}
trigger={"invite_team_members"}
@@ -238,8 +239,7 @@ export default function Billing() {
Upgrade to invite members
</Button>
</UpgradePlanModal>
- ) : limits === null ||
- (limits && limits.users! > numUsers + numInvitations) ? (
+ ) : showInvite ? (
<AddTeamMembers
open={isTeamMemberInviteModalOpen}
setOpen={setTeamMemberInviteModalOpen}