diff --git a/apps/mail/components/mail/mail-list.tsx b/apps/mail/components/mail/mail-list.tsx index 4d114e7e1..9b7ef6f5e 100644 --- a/apps/mail/components/mail/mail-list.tsx +++ b/apps/mail/components/mail/mail-list.tsx @@ -1,6 +1,5 @@ import { Archive2, - ArrowRight, Copy, ExclamationCircle, GroupPeople, @@ -63,7 +62,7 @@ const Thread = memo( const [id, setThreadId] = useQueryState('threadId'); const [focusedIndex, setFocusedIndex] = useAtom(focusedIndexAtom); const { markAsCopied, isCodeCopied } = useCopiedOtpCodes(); - const { markAsUsed, isLinkUsed } = useMagicLinks(); + const { isLinkUsed } = useMagicLinks(); const { latestMessage, idToUse, cleanName, otpCode, magicLink } = useMemo(() => { const latestMessage = getThreadData?.latest; @@ -221,6 +220,21 @@ const Thread = memo( const content = useMemo(() => { if (!latestMessage || !getThreadData) return null; + const copyCode = (e: React.MouseEvent, code: { id: string; code: string }) => { + e.stopPropagation(); + e.preventDefault(); + navigator.clipboard.writeText(code.code); + markAsCopied(code.id); + toast.success('Copied to clipboard'); + }; + + const openMagicLink = (e: React.MouseEvent, url: string) => { + e.stopPropagation(); + e.preventDefault(); + window.open(url, '_blank'); + toast.success('Opening magic link in new tab'); + }; + return (