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 (
{ event.currentTarget.querySelector("#messageInput").click(); }} className="ml-[1rem] flex-grow min-h-[4rem] flex items-center group relative overflow-x-hidden" > {/* Placeholder */} {messageEmpty && ( Message )} {/* Input */}
); } export default MessageInput;