import React from "react"; import { AnimatePresence, motion } from "framer-motion"; import { Toggle } from "@/components/ui/toggle"; import { Button } from "@/components/ui/button"; import { Mic, MicOff, Phone, BetweenHorizontalEnd, Hand } from "lucide-react"; import { cn } from "@/lib/utils"; import Visualizer from "./Visualizer"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; import { useMediaQuery } from "@/hooks/useMediaQuery"; interface ControlPanelProps { connectionStatus: string; isMuted: boolean; muteMicrophone: () => void; unmuteMicrophone: () => void; handleClickInterrupt: () => void; handleClickCloseConnection: () => void; microphoneStream: MediaStream | null | undefined; audioBuffer: AudioBuffer | null | undefined; } const ControlPanel: React.FC = ({ connectionStatus, isMuted, muteMicrophone, unmuteMicrophone, handleClickInterrupt, handleClickCloseConnection, microphoneStream, audioBuffer, }) => { const isMobile = useMediaQuery("(max-width: 768px)"); return (
{connectionStatus === "Open" ? ( { if (isMuted) { unmuteMicrophone(); } else { muteMicrophone(); } }} className="rounded-full px-2" size={isMobile ? "sm" : "lg"} > {isMuted ? ( ) : ( )}
) : null}
); }; export default ControlPanel;