import { logger } from 'matrix-js-sdk/lib/logger'; import { useMatrixClient } from '../../hooks/useMatrixClient'; import { useCallState } from '../client/CallProvider'; import { Box, Icon, IconButton, Icons, Text } from 'folds'; export function CallNavBottom() { const { sendWidgetAction, activeCallRoomId, isAudioEnabled, isVideoEnabled, toggleAudio, toggleVideo, hangUp, } = useCallState(); const mx = useMatrixClient(); const userName = mx.getUser(mx.getUserId() ?? '')?.displayName ?? mx.getUserId() ?? 'User'; const handleSendMessageClick = () => { const action = 'my.custom.action'; const data = { message: `Hello from ${userName}!` }; logger.debug(`FixedBottomNavArea: Sending action '${action}'`); sendWidgetAction(action, data) .then(() => logger.info(`FixedBottomNavArea: Action '${action}' sent.`)) .catch((err) => logger.error(`FixedBottomNavArea: Failed action '${action}':`, err)); }; if (!activeCallRoomId) { return ( No active call ); } //Muted:{(!isAudioEnabled).toString()} //Videosn't:{(!isVideoEnabled).toString()} /* */ return ( {/* Going to need better icons for this */} {mx.getRoom(activeCallRoomId)?.normalizedName} ); }