'use client'; import { useState } from 'react'; import { MailCheck, Loader2, CheckCircle, X } from 'lucide-react'; import { useTranslations } from 'next-intl'; interface ReadReceiptBannerProps { /** Address that requested the receipt (Disposition-Notification-To). */ requestedBy: string; /** Sends the MDN. Should resolve when the receipt has been submitted. */ onSend: () => Promise; /** Suppresses the request without sending (sets $MDNSent server-side). */ onIgnore: () => void; } export function ReadReceiptBanner({ requestedBy, onSend, onIgnore }: ReadReceiptBannerProps) { const t = useTranslations('email_viewer.read_receipt'); const [state, setState] = useState<'idle' | 'sending' | 'sent'>('idle'); // Matches the host's "External Content" banner row: a round tinted icon chip, // an uppercase eyebrow, a foreground message, and neutral bordered actions. if (state === 'sent') { return (
{t('sent')}
); } return (
Read receipt
{t('prompt')}
Requested by {requestedBy}
); }