Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

AskToUnmuteButton.js 1001B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { useDispatch } from 'react-redux';
  4. import { approveParticipant } from '../../av-moderation/actions';
  5. import { QuickActionButton } from './styled';
  6. type Props = {
  7. /**
  8. * The translated ask unmute text.
  9. */
  10. askUnmuteText: string,
  11. /**
  12. * Participant id.
  13. */
  14. id: string
  15. }
  16. /**
  17. * Component used to display the `ask to unmute` button.
  18. *
  19. * @param {Object} participant - Participant reference.
  20. * @returns {React$Element<'button'>}
  21. */
  22. export default function AskToUnmuteButton({ id, askUnmuteText }: Props) {
  23. const dispatch = useDispatch();
  24. const askToUnmute = useCallback(() => {
  25. dispatch(approveParticipant(id));
  26. }, [ dispatch, id ]);
  27. return (
  28. <QuickActionButton
  29. onClick = { askToUnmute }
  30. primary = { true }
  31. theme = {{
  32. panePadding: 16
  33. }}>
  34. { askUnmuteText }
  35. </QuickActionButton>
  36. );
  37. }