quivr/frontend/app/chat/components/ChatMessages/ChatInput/MicButton.tsx
Zineb El Bachiri f4aa22417f
Refactor/front (#313)
* 🚚 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
2023-06-13 16:33:41 +02:00

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>
);
}