You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MeetingParticipantItem.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // @flow
  2. import React from 'react';
  3. import { useSelector } from 'react-redux';
  4. import { getIsParticipantAudioMuted, getIsParticipantVideoMuted } from '../../base/tracks';
  5. import { ActionTrigger, MediaState } from '../constants';
  6. import { ParticipantItem } from './ParticipantItem';
  7. import { ParticipantActionEllipsis } from './styled';
  8. type Props = {
  9. /**
  10. * Is this item highlighted
  11. */
  12. isHighlighted: boolean,
  13. /**
  14. * Callback for the activation of this item's context menu
  15. */
  16. onContextMenu: Function,
  17. /**
  18. * Callback for the mouse leaving this item
  19. */
  20. onLeave: Function,
  21. /**
  22. * Participant reference
  23. */
  24. participant: Object
  25. };
  26. export const MeetingParticipantItem = ({
  27. isHighlighted,
  28. onContextMenu,
  29. onLeave,
  30. participant
  31. }: Props) => {
  32. const isAudioMuted = useSelector(getIsParticipantAudioMuted(participant));
  33. const isVideoMuted = useSelector(getIsParticipantVideoMuted(participant));
  34. return (
  35. <ParticipantItem
  36. actionsTrigger = { ActionTrigger.Hover }
  37. audioMuteState = { isAudioMuted ? MediaState.Muted : MediaState.Unmuted }
  38. isHighlighted = { isHighlighted }
  39. onLeave = { onLeave }
  40. participant = { participant }
  41. videoMuteState = { isVideoMuted ? MediaState.Muted : MediaState.Unmuted }>
  42. <ParticipantActionEllipsis onClick = { onContextMenu } />
  43. </ParticipantItem>
  44. );
  45. };