From 0ad7e04bfb2d7150bcaad71b769227807e4c86f9 Mon Sep 17 00:00:00 2001 From: alma Date: Wed, 16 Apr 2025 11:45:45 +0200 Subject: [PATCH] mail page ui correction maj 5 --- app/mail/page.tsx | 85 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 24 deletions(-) diff --git a/app/mail/page.tsx b/app/mail/page.tsx index 22791cf..92f1e15 100644 --- a/app/mail/page.tsx +++ b/app/mail/page.tsx @@ -996,35 +996,37 @@ export default function MailPage() { {(() => { try { const parsed = parseFullEmail(selectedEmail.body); - return parsed.html || parsed.text || selectedEmail.body; + return ( +
+ {/* Display HTML content if available, otherwise fallback to text */} +
+ + {/* Display attachments if present */} + {parsed.attachments && parsed.attachments.length > 0 && ( +
+

Attachments

+
+ {parsed.attachments.map((attachment, index) => ( +
+ + + {attachment.filename} + +
+ ))} +
+
+ )} +
+ ); } catch (e) { - console.error('Error parsing email content:', e); + console.error('Error parsing email:', e); return selectedEmail.body; } })()}
- - {(() => { - try { - const parsed = parseFullEmail(selectedEmail.body); - return parsed?.attachments?.length > 0 ? ( -
-

Attachments

-
- {parsed.attachments.map((attachment, index) => ( -
- - {attachment.filename} -
- ))} -
-
- ) : null; - } catch (e) { - console.error('Error parsing email attachments:', e); - return null; - } - })()} ) : (
@@ -1074,6 +1076,39 @@ export default function MailPage() { onChange={(e) => setComposeTo(e.target.value)} />
+ + {/* CC/BCC controls */} +
+ +
+ + {showCc && ( + <> +
+ + setComposeCc(e.target.value)} + /> +
+
+ + setComposeBcc(e.target.value)} + /> +
+ + )} +
setComposeSubject(e.target.value)} />
+