From 71857c7d72fbb30b5754ebff706ebf03c84a6575 Mon Sep 17 00:00:00 2001 From: Rakshat28 Date: Wed, 23 Jul 2025 08:55:13 +0530 Subject: [PATCH] show past send email fully #187 --- .../dashboard/src/pages/contacts/[id].tsx | 110 ++++++++++-------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/packages/dashboard/src/pages/contacts/[id].tsx b/packages/dashboard/src/pages/contacts/[id].tsx index a6084d4..b739707 100644 --- a/packages/dashboard/src/pages/contacts/[id].tsx +++ b/packages/dashboard/src/pages/contacts/[id].tsx @@ -33,7 +33,7 @@ interface EventValues { */ export default function Index() { const router = useRouter(); - + const [selectedEmail, setSelectedEmail] = useState(null); if (!router.isReady) { return ; } @@ -400,53 +400,69 @@ export default function Index() { {contact.triggers.length > 0 || contact.emails.length > 0 ? (
    - {[...contact.triggers, ...contact.emails] - .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) - .map((t, index) => { - if (t.messageId) { - const email = t as Email; +{[...contact.triggers, ...contact.emails] + .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()) + .map((t, index) => { + if (t.messageId) { + const email = t as Email; + const expanded = selectedEmail?.id === email.id; - return ( -
  • -
    - {contact.triggers.length + contact.emails.length - 1 !== index && ( -
    -
  • - ); - } + return ( +
  • + {contact.triggers.length + contact.emails.length - 1 !== index && ( +
  • + ); + } if (t.action) { return (