From 58f054ccfa51a56e00d8bbc07d93e2e99ad12a91 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Thu, 23 Oct 2025 11:05:03 +0330 Subject: [PATCH] cc and bcc --- src/components/newMessage/EmailInput.tsx | 15 ++++- src/components/newMessage/NewMessage.tsx | 52 ++++++++++++++++- .../newMessage/hooks/useNewMessage.ts | 57 +++++++++++++++++++ 3 files changed, 121 insertions(+), 3 deletions(-) diff --git a/src/components/newMessage/EmailInput.tsx b/src/components/newMessage/EmailInput.tsx index 57e33c5..be7fbad 100644 --- a/src/components/newMessage/EmailInput.tsx +++ b/src/components/newMessage/EmailInput.tsx @@ -8,6 +8,8 @@ interface EmailInputProps { onRemoveEmail: (email: string) => void suggestions: EmailSuggestion[] onSearchSuggestions?: (query: string) => void + showCcBccButton?: boolean + onCcBccClick?: () => void } const EmailInput: FC = ({ @@ -15,7 +17,9 @@ const EmailInput: FC = ({ onAddEmail, onRemoveEmail, suggestions, - onSearchSuggestions + onSearchSuggestions, + showCcBccButton = false, + onCcBccClick }) => { const [to, setTo] = useState('') const [filteredSuggestions, setFilteredSuggestions] = useState([]) @@ -195,6 +199,15 @@ const EmailInput: FC = ({ placeholder={toEmails.length === 0 ? "ایمیل را وارد کرده و Enter بزنید" : ""} className="flex-1 min-w-32 bg-transparent outline-none" /> + + {showCcBccButton && ( + + )} {showSuggestions && filteredSuggestions.length > 0 && ( diff --git a/src/components/newMessage/NewMessage.tsx b/src/components/newMessage/NewMessage.tsx index 4035c29..b44058c 100644 --- a/src/components/newMessage/NewMessage.tsx +++ b/src/components/newMessage/NewMessage.tsx @@ -21,10 +21,13 @@ const NewMessage: FC = () => { const [isOpening, setIsOpening] = useState(false) const [isIntelligenseOpen, setIsIntelligenseOpen] = useState(false) const [prompt, setPrompt] = useState('') + const [showCcBcc, setShowCcBcc] = useState(false) const { // Form state toEmails, + ccEmails, + bccEmails, subject, content, priority, @@ -38,6 +41,10 @@ const NewMessage: FC = () => { // Form handlers addEmail, removeEmail, + addCcEmail, + removeCcEmail, + addBccEmail, + removeBccEmail, setSubject, setContent, setPriority, @@ -76,6 +83,7 @@ const NewMessage: FC = () => { setTimeout(() => { setOpenNewMessage(false) resetForm() + setShowCcBcc(false) }, 300) } @@ -132,20 +140,60 @@ const NewMessage: FC = () => { {/* Content */}
-