({ event }: EventRowProps)
| 414 | } |
| 415 | |
| 416 | function EventRow({ event }: EventRowProps) { |
| 417 | const [expanded, setExpanded] = useState(false); |
| 418 | |
| 419 | const eventType = event.event_type || event.type || 'unknown'; |
| 420 | const typeColor = getEventTypeColor(eventType); |
| 421 | const channelColor = getChannelColor(event.channel); |
| 422 | |
| 423 | return ( |
| 424 | <div |
| 425 | className={cn( |
| 426 | 'p-2 rounded hover:bg-[var(--color-surface)] cursor-pointer transition-colors', |
| 427 | expanded && 'bg-[var(--color-surface)]' |
| 428 | )} |
| 429 | onClick={() => setExpanded(!expanded)} |
| 430 | > |
| 431 | <div className="flex items-center gap-3"> |
| 432 | {/* Expand icon */} |
| 433 | <span className="text-[var(--color-text-muted)] w-4"> |
| 434 | {expanded ? ( |
| 435 | <ChevronDown className="w-4 h-4" /> |
| 436 | ) : ( |
| 437 | <ChevronRight className="w-4 h-4" /> |
| 438 | )} |
| 439 | </span> |
| 440 | |
| 441 | {/* Timestamp */} |
| 442 | <span className="text-[var(--color-text-muted)] text-xs w-20 flex-shrink-0"> |
| 443 | {formatRelativeTime(event.timestamp)} |
| 444 | </span> |
| 445 | |
| 446 | {/* Channel badge */} |
| 447 | {event.channel && ( |
| 448 | <span |
| 449 | className="px-1.5 py-0.5 rounded text-xs flex-shrink-0" |
| 450 | style={{ backgroundColor: `${channelColor}15`, color: channelColor }} |
| 451 | > |
| 452 | {event.channel} |
| 453 | </span> |
| 454 | )} |
| 455 | |
| 456 | {/* Event type badge */} |
| 457 | <span |
| 458 | className="px-1.5 py-0.5 rounded text-xs flex-shrink-0" |
| 459 | style={{ backgroundColor: `${typeColor}20`, color: typeColor }} |
| 460 | > |
| 461 | {eventType} |
| 462 | </span> |
| 463 | |
| 464 | {/* Agent ID */} |
| 465 | {event.agent_id && ( |
| 466 | <span className="text-xs text-[var(--color-text-muted)] flex-shrink-0"> |
| 467 | @{event.agent_id.slice(0, 8)} |
| 468 | </span> |
| 469 | )} |
| 470 | |
| 471 | {/* Summary */} |
| 472 | <span className="text-[var(--color-text-secondary)] truncate"> |
| 473 | {getSummary(event)} |
nothing calls this directly
no test coverage detected