diff --git a/app/(main)/[locale]/page.tsx b/app/(main)/[locale]/page.tsx index e8a28691..9a08f6c7 100644 --- a/app/(main)/[locale]/page.tsx +++ b/app/(main)/[locale]/page.tsx @@ -3261,6 +3261,10 @@ export default function Home() { selectEmail(email); handleForward(); }} + onForwardAsAttachment={(email) => { + selectEmail(email); + handleForwardAsAttachment(); + }} onMarkAsRead={async (email, read) => { if (client) { await markAsRead(client, email.id, read); diff --git a/components/email/email-context-menu.tsx b/components/email/email-context-menu.tsx index 7cdfb1f7..d74ed5cb 100644 --- a/components/email/email-context-menu.tsx +++ b/components/email/email-context-menu.tsx @@ -34,6 +34,7 @@ import { EditIcon, CalendarClock, XCircle, + Paperclip, } from "lucide-react"; import { cn, buildMailboxTree, MailboxNode } from "@/lib/utils"; import { localizeMailboxName } from "@/lib/mailbox-label"; @@ -59,6 +60,7 @@ interface EmailContextMenuProps { onReply?: () => void; onReplyAll?: () => void; onForward?: () => void; + onForwardAsAttachment?: () => void; onMarkAsRead?: (read: boolean) => void; onToggleStar?: () => void; onTogglePinned?: () => void; @@ -127,6 +129,7 @@ export function EmailContextMenu({ onReply, onReplyAll, onForward, + onForwardAsAttachment, onMarkAsRead, onToggleStar, onTogglePinned, @@ -150,6 +153,7 @@ export function EmailContextMenu({ const t = useTranslations("context_menu"); const tSidebar = useTranslations("sidebar"); const _tColor = useTranslations("email_viewer.color_tag"); + const tEmailViewer = useTranslations("email_viewer"); const emailKeywords = useSettingsStore((state) => state.emailKeywords); const isUnread = !email.keywords?.$seen; const isStarred = email.keywords?.$flagged; @@ -277,6 +281,12 @@ export function EmailContextMenu({ onClick={() => handleAction(onForward!)} disabled={!onForward} /> + handleAction(onForwardAsAttachment!)} + disabled={!onForwardAsAttachment || !email.blobId} + /> )} diff --git a/components/email/email-list.tsx b/components/email/email-list.tsx index 8f1db908..6dfe4c33 100644 --- a/components/email/email-list.tsx +++ b/components/email/email-list.tsx @@ -33,6 +33,7 @@ interface EmailListProps { onReply?: (email: Email) => void; onReplyAll?: (email: Email) => void; onForward?: (email: Email) => void; + onForwardAsAttachment?: (email: Email) => void; onMarkAsRead?: (email: Email, read: boolean) => void; onToggleStar?: (email: Email) => void; onTogglePinned?: (email: Email) => void; @@ -63,6 +64,7 @@ export function EmailList({ onReply, onReplyAll, onForward, + onForwardAsAttachment, onMarkAsRead, onToggleStar, onTogglePinned, @@ -583,6 +585,7 @@ export function EmailList({ onReply={() => onReply?.(contextMenu.data!)} onReplyAll={() => onReplyAll?.(contextMenu.data!)} onForward={() => onForward?.(contextMenu.data!)} + onForwardAsAttachment={() => onForwardAsAttachment?.(contextMenu.data!)} onMarkAsRead={(read) => onMarkAsRead?.(contextMenu.data!, read)} onToggleStar={() => onToggleStar?.(contextMenu.data!)} onTogglePinned={onTogglePinned ? () => onTogglePinned(contextMenu.data!) : undefined}