courrier multi account restore compose

This commit is contained in:
alma 2025-04-27 21:55:03 +02:00
parent 61e758f341
commit cf2bf52357

View File

@ -1,7 +1,7 @@
'use client'; 'use client';
import { useState, useRef, useEffect } from 'react'; import { useState, useRef, useEffect } from 'react';
import { formatEmailForReplyOrForward, EmailMessage, EmailAddress } from '@/lib/utils/email-formatter'; import { formatEmailForReplyOrForward, EmailMessage, EmailAddress } from '@/lib/services/email-service';
import { X, Paperclip, ChevronDown, ChevronUp, SendHorizontal, Loader2 } from 'lucide-react'; import { X, Paperclip, ChevronDown, ChevronUp, SendHorizontal, Loader2 } from 'lucide-react';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input';
@ -162,13 +162,13 @@ export default function ComposeEmail({
// Format the forwarded message with a well-structured header // Format the forwarded message with a well-structured header
const fromString = Array.isArray(initialEmail.from) && initialEmail.from.length > 0 const fromString = Array.isArray(initialEmail.from) && initialEmail.from.length > 0
? initialEmail.from.map((addr: {name?: string, address: string}) => addr.name ? initialEmail.from.map(addr => addr.name
? `${addr.name} <${addr.address}>` ? `${addr.name} <${addr.address}>`
: addr.address).join(', ') : addr.address).join(', ')
: 'Unknown'; : 'Unknown';
const toString = Array.isArray(initialEmail.to) && initialEmail.to.length > 0 const toString = Array.isArray(initialEmail.to) && initialEmail.to.length > 0
? initialEmail.to.map((addr: {name?: string, address: string}) => addr.name ? initialEmail.to.map(addr => addr.name
? `${addr.name} <${addr.address}>` ? `${addr.name} <${addr.address}>`
: addr.address).join(', ') : addr.address).join(', ')
: ''; : '';
@ -522,7 +522,6 @@ export default function ComposeEmail({
variant="outline" variant="outline"
size="sm" size="sm"
onClick={handleAttachmentClick} onClick={handleAttachmentClick}
className="bg-white hover:bg-gray-100 border-gray-300"
> >
<Paperclip className="h-4 w-4 mr-1" /> <Paperclip className="h-4 w-4 mr-1" />
Attach Attach
@ -533,7 +532,6 @@ export default function ComposeEmail({
size="sm" size="sm"
onClick={handleSend} onClick={handleSend}
disabled={sending} disabled={sending}
className="bg-blue-600 text-white hover:bg-blue-700"
> >
{sending ? ( {sending ? (
<> <>