import React, { useState } from 'react' import stl from './ChatControls.css' import cn from 'classnames' import { Button, Icon } from 'UI' import type { LocalStream } from 'Player/MessageDistributor/managers/LocalStream'; interface Props { stream: LocalStream | null, endCall: () => void } function ChatControls({ stream, endCall } : Props) { const [audioEnabled, setAudioEnabled] = useState(true) const [videoEnabled, setVideoEnabled] = useState(false) const toggleAudio = () => { if (!stream) { return; } setAudioEnabled(stream.toggleAudio()); } const toggleVideo = () => { if (!stream) { return; } stream.toggleVideo() .then(setVideoEnabled) } return (