// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import React from "react"; import { PreviewVideo, RemoteVideo, useLocalVideo, useRemoteVideoTileState, useToggleLocalMute } from "amazon-chime-sdk-component-library-react"; import { Box, Button, Grid, Modal, Toggle } from "aws-northstar"; import Text from 'aws-northstar/components/Text'; interface ModalChimeDialogProperties { onEndCall: any; infoPanel?: React.ReactNode; } /** * This component is the initial implementation of a chime sdk chat interface - * with only very basic controls at this stage * * @param onEndCall - function object invoked when the user leaves the chime session */ const ModalChimeDialog: React.FC = ({ onEndCall, infoPanel }) => { const { toggleVideo, isVideoEnabled } = useLocalVideo(); const { muted, toggleMute } = useToggleLocalMute(); const { tiles } = useRemoteVideoTileState(); const videos = tiles.map((tileId) => (
)); return (
{tiles.length ? videos : No remote video available }
{isVideoEnabled ? : Video disabled }
{ infoPanel ?
: null} { infoPanel ? {infoPanel} : null}
) } export default ModalChimeDialog;