import type { MouseEvent } from 'react'; import { useRef } from 'react'; import { useOutsideClick } from '../../hooks/use-outside-click'; import { useCopyText } from '../../hooks/use-copy-text'; import { CopyIcon } from 'lucide-react'; type InviteFriendPopupProps = { befriendUrl: string; onClose: () => void; }; export function InviteFriendPopup(props: InviteFriendPopupProps) { const { onClose, befriendUrl } = props; const { isCopied, copyText } = useCopyText(); const popupBodyRef = useRef(null); const handleClosePopup = () => { onClose(); }; useOutsideClick(popupBodyRef, handleClosePopup); return (

Invite URL

Share the link below with your friends to invite them.

) => { (e?.target as HTMLInputElement)?.select(); copyText(befriendUrl); }} />
); }