import { cn } from "@/lib/utils"; import { useVoice } from "../../context/VoiceContext"; /** * GlobalMicButton — Phase 14 wiring of the top-strip voice affordance. * * Consumes `VoiceContext` directly; the `state` and `onClick` scaffolding * props from Phase 8 are gone. Click cycles through * idle → listening → (on stop) speaking → idle * via `VoiceContext.toggleListening()`. * * Per docs/specs/2026-04-11-nexus-layout-overhaul.md §4.2 the three visual * states are: * - idle: forest-green dot, no animation * - listening: volt fill, 1.5s pulse loop + expanding volt ring * - speaking: silver fill, no pulse * * Literal hex `#166534` (forest) and `#a0a0a0` (silver) are used because * MIGRATION-PLAN.md §3 proposes these as new CSS variables but has not yet * shipped them. Volt uses the `text-primary`/`bg-primary` semantic token. */ export function GlobalMicButton() { const { state, toggleListening, hasQueuedVoice } = useVoice(); const label = state === "listening" ? "Voice — listening" : state === "speaking" ? "Voice — processing" : hasQueuedVoice ? "Voice (queued)" : "Voice"; return ( ); }