function MessagePane({ msg, msgTags, attachments, token, onToggleUnread, onStar, onArchive, onUnarchive, onDelete, onReply, archived, busy, account, }) { const [reply, setReply] = React.useState(""); React.useEffect(() => { setReply(""); }, [msg?.id]); if (!msg) { return (
Select a message
); } const html = decodeBodyHtml(msg.body_html) || "
" + (msg.body_text || "") + "
"; const btn = "text-xs px-2.5 py-1 rounded border border-paper-line text-ink-muted hover:border-accent hover:text-accent"; const chips = (msgTags || []).filter((t) => t !== "archive"); return (

{msg.subject}

From {msg.from_addr} To {msg.to_addr} {formatWhen(msg.created_at)}
{chips.length > 0 && (
{chips.map((t) => ( #{t} ))}
)} {(attachments || []).length > 0 && (
{attachments.map((a) => ( {a.filename || "attachment"} ))}
)}
{archived ? ( ) : ( )}
{msg.direction !== "out" && (
{ e.preventDefault(); if (!reply.trim() || busy) return; onReply(reply.trim()).then(() => setReply("")); }} >
From {account?.address || msg.received_for || msg.to_addr || "—"}