feat: Add bounce and complaint filter to activity feed

This commit is contained in:
Dries Augustyns
2026-01-21 20:52:23 +01:00
parent e16093a264
commit c85df75d53
4 changed files with 45 additions and 2 deletions
+26 -1
View File
@@ -11,6 +11,7 @@ import {
Eye,
MousePointerClick,
Send,
ShieldAlert,
Workflow,
XCircle,
Zap,
@@ -95,7 +96,14 @@ function getUpcomingTime(date: Date): string {
* Check if an activity is an email activity
*/
function isEmailActivity(type: string): boolean {
return ['email.sent', 'email.delivered', 'email.opened', 'email.clicked', 'email.bounced'].includes(type);
return [
'email.sent',
'email.delivered',
'email.opened',
'email.clicked',
'email.bounced',
'email.complaint',
].includes(type);
}
interface ActivityItemProps {
@@ -226,6 +234,23 @@ function getActivityConfig(activity: Activity): ActivityConfig {
},
};
case 'email.complaint':
return {
icon: ShieldAlert,
color: 'text-red-600',
bgColor: 'bg-red-100',
title: (typeof metadata.subject === 'string' ? metadata.subject : undefined) || 'Spam complaint',
description: metadata.campaignName
? `Campaign: ${String(metadata.campaignName)}`
: metadata.workflowName
? `Workflow: ${String(metadata.workflowName)}`
: 'Recipient marked as spam',
badge: {
label: 'Complaint',
variant: 'destructive',
},
};
case 'workflow.started':
return {
icon: Workflow,