diff --git a/src/components/newMessage/Reply.tsx b/src/components/newMessage/Reply.tsx index e0ce9eb..93a1508 100644 --- a/src/components/newMessage/Reply.tsx +++ b/src/components/newMessage/Reply.tsx @@ -5,6 +5,7 @@ import AvatarImage from '@/assets/images/avatar.svg' import AnswerIcon from '@/assets/images/answer.svg' import EmailEditor from './EmailEditor' import EmailFormActions from './EmailFormActions' +import EmailAttachments from './EmailAttachments' import { useReply } from './hooks/useReply' import { MessageDetail } from '@/pages/received/types/Types' import { toast } from '@/components/Toast' @@ -30,7 +31,9 @@ const Reply: FC = ({ content, isExpanded, isSending, + attachments, setContent, + setAttachments, expandReply, collapseReply, handleSendReply, @@ -137,6 +140,13 @@ const Reply: FC = ({ /> +
+ +
+ (""); const [isExpanded, setIsExpanded] = useState(false); + const [attachments, setAttachments] = useState([]); const sendEmailMutation = useSendEmail(); const resetForm = () => { setContent(""); setIsExpanded(false); + setAttachments([]); }; const handleSendReply = async (html: string) => { @@ -97,6 +99,7 @@ ${ originalMessage.html?.join("").replace(/<[^>]*>/g, "") || "" }`, + attachments: attachments.length > 0 ? attachments : undefined, }; try { @@ -144,8 +147,10 @@ ${ content, isExpanded, isSending: sendEmailMutation.isPending, + attachments, setContent, + setAttachments, expandReply, collapseReply, handleSendReply,