"use client"; import { Mic, MicOff } from "lucide-react"; import { GlassCard } from "@/components/glass/card"; import type { ActiveSpeaker } from "@/lib/types"; interface ActivityTimelineProps { data?: ActiveSpeaker[]; } /** * Voice Activity — live view of everyone currently in the monitored voice * channel and whether they are speaking right now. * * Previously this rendered a Recharts bar chart fed from a `{user, duration}` * prop that NO caller ever supplied, so the Activity tab always showed an * empty, misleading chart. It now renders real live speaker state from the * WebSocket (same source as the Connection tab's waveform). */ export function VoiceActivityTimeline({ data = [] }: ActivityTimelineProps) { const sorted = [...data].sort((a, b) => a.speaking === b.speaking ? String(a.username).localeCompare(b.username) : a.speaking ? -1 : 1, ); return (
Voice Activity {sorted.length} speaker{sorted.length !== 1 ? "s" : ""} · live
{sorted.length === 0 ? (

No speakers in the monitored voice channel.

Connect to a voice channel to see live activity here.

) : (
{sorted.map((s) => (
{s.speaking ? ( ) : ( )} {s.username} {s.speaking ? "Speaking" : "Listening"}
))}
)}
); }