import { Mic, Loader2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { VoiceWaveform } from "./VoiceWaveform"; import { useVadRecorder } from "../hooks/useVadRecorder"; interface VoiceMicButtonProps { onTranscript: (text: string) => void; disabled?: boolean; } export function VoiceMicButton({ onTranscript, disabled }: VoiceMicButtonProps) { const { state, start, stop, mediaStream } = useVadRecorder({ onTranscript }); // Idle state (also used when disabled) if (state === "idle") { return ( ); } // Recording state — show waveform with primary ring, click to stop if (state === "recording") { return ( ); } // Processing state — transcribing, disabled return ( ); }