courrier refactor rebuild preview
This commit is contained in:
parent
3c4151335b
commit
9970c7b4c9
@ -9,11 +9,9 @@ import { sanitizeHtml } from '@/lib/utils/email-formatter';
|
||||
import { Avatar, AvatarFallback } from '@/components/ui/avatar';
|
||||
import { AvatarImage } from '@/components/ui/avatar';
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { formatDate } from '@/lib/date';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { CalendarIcon, PaperclipIcon } from 'lucide-react';
|
||||
import Link from 'next/link';
|
||||
import { formatEmailContent } from '@/lib/email-formatter';
|
||||
|
||||
interface EmailAddress {
|
||||
name: string;
|
||||
@ -121,8 +119,8 @@ export default function EmailPreview({ email, loading = false, onReply }: EmailP
|
||||
|
||||
const sender = email.from && email.from.length > 0 ? email.from[0] : undefined;
|
||||
|
||||
// Format email content for display
|
||||
const formattedContent = formatEmailContent(email.content, 'preview');
|
||||
// Use sanitizeHtml directly, matching the approach in ComposeEmail
|
||||
const sanitizedContent = sanitizeHtml(email.content || email.html || email.text || '');
|
||||
|
||||
return (
|
||||
<Card className="flex flex-col h-full overflow-hidden border-0 shadow-none">
|
||||
@ -212,10 +210,12 @@ export default function EmailPreview({ email, loading = false, onReply }: EmailP
|
||||
)}
|
||||
style={{
|
||||
overflowWrap: 'break-word',
|
||||
wordBreak: 'break-word'
|
||||
wordBreak: 'break-word',
|
||||
textAlign: 'right'
|
||||
}}
|
||||
dir="rtl"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: formattedContent
|
||||
__html: sanitizedContent
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user