/** * src/components/CallView/index.jsx * User can stop or continue the call. Allows audios playing and switch to TextView. * * created by Lynchee on 7/16/23 */ import React, { useEffect, useRef } from 'react'; import './style.css'; import { TbPhoneCall } from 'react-icons/tb'; import { MdCallEnd } from 'react-icons/md'; import { TbMessageChatbot, TbPower } from 'react-icons/tb'; import IconButton from '../Common/IconButton'; // utils import { playAudios } from '../../utils/audioUtils'; const CallView = ( {isRecording, isPlaying, audioPlayer, handleStopCall, handleContinueCall, audioQueue, setIsPlaying, handleDisconnect, setIsCallView} ) => { const audioContextRef = useRef(null); useEffect(() => { if (isPlaying) { playAudios(audioContextRef, audioPlayer, audioQueue, setIsPlaying); } }, [isPlaying]); return ( <>
setIsCallView(false)} />
) } export default CallView