import React from 'react'; import { Aside } from '@custom/shared/components/Aside'; import { ReactComponent as IconCamOff } from '@custom/shared/icons/camera-off-sm.svg'; import { ReactComponent as IconCamOn } from '@custom/shared/icons/camera-on-sm.svg'; import { ReactComponent as IconMicOff } from '@custom/shared/icons/mic-off-sm.svg'; import { ReactComponent as IconMicOn } from '@custom/shared/icons/mic-on-sm.svg'; import PropTypes from 'prop-types'; import { useCallState } from '../../contexts/CallProvider'; import { useParticipants } from '../../contexts/ParticipantsProvider'; import { useUIState } from '../../contexts/UIStateProvider'; import Button from '../Button'; export const PEOPLE_ASIDE = 'people'; const PersonRow = ({ participant, isOwner = false }) => (
{participant.name} {participant.isLocal && '(You)'}
{!isOwner ? ( <> {participant.isCamMuted ? : } {participant.isMicMuted ? : } ) : ( <> )}
); PersonRow.propTypes = { participant: PropTypes.object, isOwner: PropTypes.bool, }; export const PeopleAside = () => { const { callObject } = useCallState(); const { showAside, setShowAside } = useUIState(); const { participants, isOwner } = useParticipants(); if (!showAside || showAside !== PEOPLE_ASIDE) { return null; } return ( ); }; export default PeopleAside;