import { AnimatePresence, motion } from "framer-motion"; import { useDispatch } from "react-redux"; import { modalActions } from "../../../store/modalSlice"; function MessageInput({ isRecording, handleInput, messageEmpty, getCaretIndex, emitTypingEvent, }) { const dispatch = useDispatch(); // Ask for confirmation to terminate recording if user is currenly recording a message const terminateRecording = (event) => { getCaretIndex(event); if (isRecording) { event.currentTarget.blur(); dispatch(modalActions.openModal({ type: "stopRecordModal" })); } }; return (