diff --git a/src/app/pages/call/CallNavBottom.tsx b/src/app/pages/call/CallNavBottom.tsx new file mode 100644 index 00000000..d4ff7a43 --- /dev/null +++ b/src/app/pages/call/CallNavBottom.tsx @@ -0,0 +1,65 @@ +import { logger } from 'matrix-js-sdk/lib/logger'; +import { useMatrixClient } from '../../hooks/useMatrixClient'; +import { useCallState } from '../client/CallProvider'; +import { Box, 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 + + + ); + } + + return ( + + + {/* Going to need better icons for this */} + + + + + + + {mx.getRoom(activeCallRoomId)?.normalizedName} + + ); +}