/** * Recent activity card (mcp-ai-spec §6.2.6): last 50 MCP calls — * time, tool, actor label, ok/error, duration — with an empty state. */ import { RefreshCw } from 'lucide-react'; import type { McpActivityEntry } from './types'; import { McpCard } from './card'; import { Button } from '@/components/ui/button'; import { __ } from '../../lib/i18n'; function formatTs(ts: number): string { if (!ts) return '—'; return new Date(ts * 1000).toLocaleString(); } export function ActivityLog({ entries, loading, onRefresh, }: { entries: McpActivityEntry[]; loading: boolean; onRefresh: () => void; }) { return ( {__('Refresh', 'llmagnet-llm-txt-generator')} } > {entries.length === 0 ? (

{__('No MCP calls yet — connect a client above.', 'llmagnet-llm-txt-generator')}

) : (
{entries.map((entry, i) => ( ))}
{__('Time', 'llmagnet-llm-txt-generator')} {__('Actor', 'llmagnet-llm-txt-generator')} {__('Tool', 'llmagnet-llm-txt-generator')} {__('Result', 'llmagnet-llm-txt-generator')} {__('Duration', 'llmagnet-llm-txt-generator')}
{formatTs(entry.ts)} {entry.auth === 'auth_failed' ? ( {__('auth failed', 'llmagnet-llm-txt-generator')} ) : ( entry.auth || '—' )} {entry.tool ? ( {entry.tool} ) : ( — )} {entry.ok ? __('OK', 'llmagnet-llm-txt-generator') : __('Error', 'llmagnet-llm-txt-generator')} {entry.ms} ms
)}
); }