import React, { Fragment } from 'react'; import { Avatar } from '../TwAvatar'; import { Button } from '../Button'; import { HandFilledIcon, MicOffIcon, MicOnIcon, SettingsIcon } from '../Icons'; import { Text } from '../Text'; import { ParticipantListClasses } from './ParticipantProps'; import { StylerType } from '../../types'; import { selectIsPeerAudioEnabled, selectPermissions, } from '@100mslive/hms-video-store'; import { useHMSStore } from '../../hooks/HMSRoomProvider'; interface PropsType { styler?: StylerType; name: string; peerId: string; onUserSettingsClick?: () => void; isHandRaised?: boolean; isPreview: boolean; } const Icons = ({ styler = () => '', peerId, onUserSettingsClick, isHandRaised, }: Omit) => { const permissions = useHMSStore(selectPermissions); const isAudioEnabled = useHMSStore(selectIsPeerAudioEnabled(peerId)); return ( {permissions?.changeRole && (
)}
{isHandRaised && (
)}
); }; const ListItem = ({ styler = () => '', name, peerId, onUserSettingsClick, isHandRaised, isPreview, }: PropsType & { isPreview: boolean }) => { return (
{name}
{!isPreview ? ( ) : null}
); }; export const ParticipantInList = React.memo( ListItem, (prev, next) => prev.peerId === next.peerId, );