@@ -18,6 +18,7 @@ import {
1818 DropdownMenuItem ,
1919 DropdownMenuTrigger ,
2020} from "@/components/ui/dropdown-menu" ;
21+ import { BASE_URL } from "@/constants/env" ;
2122import { useMutation } from "@tanstack/react-query" ;
2223import { formatDate } from "date-fns" ;
2324import { EllipsisIcon , MailIcon } from "lucide-react" ;
@@ -117,6 +118,7 @@ export function ManageInvitesSection(props: {
117118 className = "border-border border-b last:border-b-0"
118119 >
119120 < InviteRow
121+ teamSlug = { props . team . slug }
120122 invite = { invite }
121123 client = { props . client }
122124 userHasEditPermission = { props . userHasEditPermission }
@@ -143,6 +145,7 @@ export function ManageInvitesSection(props: {
143145}
144146
145147function InviteRow ( props : {
148+ teamSlug : string ;
146149 invite : TeamInvite ;
147150 userHasEditPermission : boolean ;
148151 client : ThirdwebClient ;
@@ -198,6 +201,7 @@ function InviteRow(props: {
198201 { /* Options */ }
199202 { props . userHasEditPermission && (
200203 < ManageInviteButton
204+ teamSlug = { props . teamSlug }
201205 invite = { props . invite }
202206 userHasEditPermission = { props . userHasEditPermission }
203207 deleteInvite = { props . deleteInvite }
@@ -210,6 +214,7 @@ function InviteRow(props: {
210214}
211215
212216function ManageInviteButton ( props : {
217+ teamSlug : string ;
213218 invite : TeamInvite ;
214219 userHasEditPermission : boolean ;
215220 deleteInvite : ( inviteId : string ) => Promise < void > ;
@@ -235,6 +240,18 @@ function ManageInviteButton(props: {
235240 </ Button >
236241 </ DropdownMenuTrigger >
237242 < DropdownMenuContent align = "end" className = "w-40" >
243+ { props . invite . status === "pending" && (
244+ < DropdownMenuItem
245+ onClick = { ( ) => {
246+ navigator . clipboard . writeText (
247+ `${ BASE_URL } /join/team/${ props . teamSlug } /${ props . invite . id } ` ,
248+ ) ;
249+ toast . success ( "Invite link copied to clipboard" ) ;
250+ } }
251+ >
252+ Copy Invite Link
253+ </ DropdownMenuItem >
254+ ) }
238255 < DropdownMenuItem
239256 className = "text-destructive focus:text-destructive"
240257 onClick = { ( ) => setShowDeleteDialog ( true ) }
0 commit comments