Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ParticipantQuickAction.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // @flow
  2. import React from 'react';
  3. import { QUICK_ACTION_BUTTON } from '../constants';
  4. import AskToUnmuteButton from './AskToUnmuteButton';
  5. import { QuickActionButton } from './web/styled';
  6. type Props = {
  7. /**
  8. * The translated ask unmute aria label.
  9. */
  10. ariaLabel?: boolean,
  11. /**
  12. * The translated "ask unmute" text.
  13. */
  14. askUnmuteText: string,
  15. /**
  16. * The type of button to be displayed.
  17. */
  18. buttonType: string,
  19. /**
  20. * Callback used to open a confirmation dialog for audio muting.
  21. */
  22. muteAudio: Function,
  23. /**
  24. * Label for mute participant button.
  25. */
  26. muteParticipantButtonText: string,
  27. /**
  28. * The ID of the participant.
  29. */
  30. participantID: string,
  31. }
  32. /**
  33. * Component used to display mute/ask to unmute button.
  34. *
  35. * @param {Props} props - The props of the component.
  36. * @returns {React$Element<'button'>}
  37. */
  38. export default function ParticipantQuickAction({
  39. askUnmuteText,
  40. buttonType,
  41. muteAudio,
  42. muteParticipantButtonText,
  43. participantID
  44. }: Props) {
  45. switch (buttonType) {
  46. case QUICK_ACTION_BUTTON.MUTE: {
  47. return (
  48. <QuickActionButton
  49. onClick = { muteAudio(participantID) }
  50. primary = { true }>
  51. { muteParticipantButtonText }
  52. </QuickActionButton>
  53. );
  54. }
  55. default: {
  56. return (
  57. <AskToUnmuteButton
  58. askUnmuteText = { askUnmuteText }
  59. participantID = { participantID } />
  60. );
  61. }
  62. }
  63. }