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.

AudioModerationNotifications.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { useSelector } from 'react-redux';
  4. import NotificationWithParticipants from '../../notifications/components/web/NotificationWithParticipants';
  5. import {
  6. approveParticipant,
  7. dismissPendingAudioParticipant
  8. } from '../actions';
  9. import { getParticipantsAskingToAudioUnmute } from '../functions';
  10. /**
  11. * Component used to display a list of participants who asked to be unmuted.
  12. * This is visible only to moderators.
  13. *
  14. * @returns {React$Element<'ul'> | null}
  15. */
  16. export default function() {
  17. const participants = useSelector(getParticipantsAskingToAudioUnmute);
  18. const { t } = useTranslation();
  19. return participants.length
  20. ? (
  21. <>
  22. <div className = 'title'>
  23. { t('raisedHand') }
  24. </div>
  25. <NotificationWithParticipants
  26. approveButtonText = { t('notify.unmute') }
  27. onApprove = { approveParticipant }
  28. onReject = { dismissPendingAudioParticipant }
  29. participants = { participants }
  30. rejectButtonText = { t('dialog.dismiss') }
  31. testIdPrefix = 'avModeration' />
  32. </>
  33. ) : null;
  34. }