mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-21 02:11:35 +03:00
f4aa22417f
* 🚚 move footer component * 🚚 move navbar component * 🚚 move ui components * 🚚 move browser tab icon to public folder * 🚚 move Chat Provider * 🚚 move hooks to lib * 🚚 move helpers to lib * 🚚 move types to lib
25 lines
600 B
TypeScript
25 lines
600 B
TypeScript
"use client";
|
|
import Button from "@/lib/components/ui/Button";
|
|
import { useSpeech } from "@/lib/context/ChatsProvider/hooks/useSpeech";
|
|
import { MdMic, MdMicOff } from "react-icons/md";
|
|
|
|
export function MicButton() {
|
|
const { isListening, speechSupported, startListening } = useSpeech();
|
|
|
|
return (
|
|
<Button
|
|
className="px-3"
|
|
variant={"tertiary"}
|
|
type="button"
|
|
onClick={startListening}
|
|
disabled={!speechSupported}
|
|
>
|
|
{isListening ? (
|
|
<MdMicOff className="text-2xl" />
|
|
) : (
|
|
<MdMic className="text-2xl" />
|
|
)}
|
|
</Button>
|
|
);
|
|
}
|