diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/BulkProcessActivityLog.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/BulkProcessActivityLog.tsx new file mode 100644 index 0000000000..808e631167 --- /dev/null +++ b/apps/web/app/(app)/[emailAccountId]/assistant/BulkProcessActivityLog.tsx @@ -0,0 +1,252 @@ +"use client"; + +import { useEffect, useState } from "react"; +import { CheckCircle2Icon, LoaderIcon } from "lucide-react"; +import useSWR from "swr"; +import type { BatchExecutedRulesResponse } from "@/app/api/user/executed-rules/batch/route"; +import type { ThreadsResponse } from "@/app/api/threads/route"; +import { Badge } from "@/components/Badge"; + +export type ActivityLogEntry = { + id: string; + from: string; + subject: string; + status: "processing" | "completed" | "waiting"; + ruleName?: string; +}; + +export function ActivityLog({ + entries, + processingCount = 0, + paused = false, + title = "Processing Activity", + loading = false, +}: { + entries: ActivityLogEntry[]; + processingCount?: number; + paused?: boolean; + title?: string; + loading?: boolean; +}) { + if (entries.length === 0 && !loading) return null; + + return ( +
+ Default with mixed states: +
+Paused state:
++ Long text truncation test: +
+All completed:
+