From c9007f29dc2a10b0011be43feb4988ffd7c88a28 Mon Sep 17 00:00:00 2001 From: alma Date: Fri, 25 Apr 2025 10:15:49 +0200 Subject: [PATCH] panel 2 courrier estore --- app/courrier/page.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index f4b7eb43..38fdb857 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -53,6 +53,7 @@ export interface Email { starred: boolean; attachments?: { name: string; url: string }[]; folder: string; + cc?: string; } interface Attachment { @@ -619,7 +620,7 @@ export default function CourrierPage() { }; // Update handleEmailSelect to set selectedEmail correctly - const handleEmailSelect = async (emailId: number) => { + const handleEmailSelect = async (emailId: string) => { const email = emails.find(e => e.id === emailId); if (!email) { return; @@ -641,11 +642,14 @@ export default function CourrierPage() { // Update the email in the list and selected email with full content setEmails(prevEmails => prevEmails.map(email => email.id === emailId - ? { ...email, body: fullEmail.body || email.body } + ? { ...email, content: fullEmail.content || fullEmail.body || email.content } : email )); - setSelectedEmail(prev => prev ? { ...prev, body: fullEmail.body || prev.body } : prev); + setSelectedEmail(prev => prev ? { + ...prev, + content: fullEmail.content || fullEmail.body || prev.content + } : prev); setContentLoading(false); // Try to mark as read in the background @@ -814,7 +818,7 @@ export default function CourrierPage() { email.subject.toLowerCase().includes(query) || email.from.toLowerCase().includes(query) || email.to.toLowerCase().includes(query) || - email.body.toLowerCase().includes(query) + email.content.toLowerCase().includes(query) ); }, [sortedEmails, searchQuery]); @@ -1260,8 +1264,8 @@ export default function CourrierPage() { } }; - // Add back the toggleStarred function - const toggleStarred = async (emailId: number, e?: React.MouseEvent) => { + // Update toggleStarred to use string IDs + const toggleStarred = async (emailId: string, e?: React.MouseEvent) => { if (e) { e.stopPropagation(); }