@@ -18,6 +18,7 @@ import {
18
18
DropdownMenuItem ,
19
19
DropdownMenuTrigger ,
20
20
} from "@/components/ui/dropdown-menu" ;
21
+ import { BASE_URL } from "@/constants/env" ;
21
22
import { useMutation } from "@tanstack/react-query" ;
22
23
import { formatDate } from "date-fns" ;
23
24
import { EllipsisIcon , MailIcon } from "lucide-react" ;
@@ -117,6 +118,7 @@ export function ManageInvitesSection(props: {
117
118
className = "border-border border-b last:border-b-0"
118
119
>
119
120
< InviteRow
121
+ teamSlug = { props . team . slug }
120
122
invite = { invite }
121
123
client = { props . client }
122
124
userHasEditPermission = { props . userHasEditPermission }
@@ -143,6 +145,7 @@ export function ManageInvitesSection(props: {
143
145
}
144
146
145
147
function InviteRow ( props : {
148
+ teamSlug : string ;
146
149
invite : TeamInvite ;
147
150
userHasEditPermission : boolean ;
148
151
client : ThirdwebClient ;
@@ -198,6 +201,7 @@ function InviteRow(props: {
198
201
{ /* Options */ }
199
202
{ props . userHasEditPermission && (
200
203
< ManageInviteButton
204
+ teamSlug = { props . teamSlug }
201
205
invite = { props . invite }
202
206
userHasEditPermission = { props . userHasEditPermission }
203
207
deleteInvite = { props . deleteInvite }
@@ -210,6 +214,7 @@ function InviteRow(props: {
210
214
}
211
215
212
216
function ManageInviteButton ( props : {
217
+ teamSlug : string ;
213
218
invite : TeamInvite ;
214
219
userHasEditPermission : boolean ;
215
220
deleteInvite : ( inviteId : string ) => Promise < void > ;
@@ -235,6 +240,18 @@ function ManageInviteButton(props: {
235
240
</ Button >
236
241
</ DropdownMenuTrigger >
237
242
< 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
+ ) }
238
255
< DropdownMenuItem
239
256
className = "text-destructive focus:text-destructive"
240
257
onClick = { ( ) => setShowDeleteDialog ( true ) }
0 commit comments