diff --git a/apps/web/components/rooms/participants-sidebar.tsx b/apps/web/components/rooms/participants-sidebar.tsx index 44b5bbc8..6a1f5ad1 100644 --- a/apps/web/components/rooms/participants-sidebar.tsx +++ b/apps/web/components/rooms/participants-sidebar.tsx @@ -10,6 +10,7 @@ import { SheetHeader, SheetTitle, } from "@call/ui/components/sheet"; +import { usePathname } from "next/navigation"; import { useEffect, useRef, useState } from "react"; import { FiCheck, @@ -159,6 +160,20 @@ export function ParticipantsSidebar({ } }; + // Generate shareable invite URL for the current call + const invitePath = usePathname(); + const inviteURL = `${window.location.origin}${invitePath}`; + + const copyInviteURL = async () => { + try { + await navigator.clipboard.writeText(inviteURL); + toast.success("Invite link copied"); + } catch (error) { + console.error("Error copying invite URL:", error); + toast.error("Failed to copy invite link"); + } + }; + return ( @@ -342,6 +357,11 @@ export function ParticipantsSidebar({ )} +
+ +
);