"use client"; import type { ActivityEvent } from "@/lib/activity"; import { ActivityItem } from "./ActivityItem"; interface Props { events: ActivityEvent[]; collapsed: boolean; compact?: boolean; onToggleCollapse: () => void; onExpandPanel: () => void; onNodeClick: (nodeId: string) => void; onHandleClick?: (handle: string) => void; } /** * Compact always-visible activity card in the top-right of the graph canvas. * Shows latest 5 events. Click "See all" to open the full ActivityPanel. */ export function ActivityOverlay({ events, collapsed, compact, onToggleCollapse, onExpandPanel, onNodeClick, onHandleClick, }: Props) { // Count events in last 5 minutes for the collapsed badge const recentCount = events.filter( (e) => Date.now() - e.time < 5 * 60 * 1000 ).length; if (collapsed) { return ( ); } return (
{/* Header */}
Live Activity
{/* Event list */}
{events.length === 0 ? (

No activity yet

) : ( events.slice(0, compact ? 3 : 6).map((event, i) => (
)) )}
{/* Footer */} {events.length > 0 && (
{events.length} event{events.length !== 1 ? "s" : ""}
)}
); }