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.

ConnectionStatusButton.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // @flow
  2. import React, { useCallback } from 'react';
  3. import { translate } from '../../../base/i18n';
  4. import { IconInfo } from '../../../base/icons';
  5. import { connect } from '../../../base/redux';
  6. import { renderConnectionStatus } from '../../actions.web';
  7. import VideoMenuButton from './VideoMenuButton';
  8. type Props = {
  9. /**
  10. * The Redux dispatch function.
  11. */
  12. dispatch: Function,
  13. /**
  14. * The ID of the participant for which to show connection stats.
  15. */
  16. participantId: string,
  17. /**
  18. * The function to be used to translate i18n labels.
  19. */
  20. t: Function
  21. };
  22. const ConnectionStatusButton = ({
  23. dispatch,
  24. participantId,
  25. t
  26. }: Props) => {
  27. const onClick = useCallback(() => {
  28. dispatch(renderConnectionStatus(true));
  29. }, [ dispatch ]);
  30. return (
  31. <VideoMenuButton
  32. buttonText = { t('videothumbnail.connectionInfo') }
  33. icon = { IconInfo }
  34. id = { `connstatus_${participantId}` }
  35. onClick = { onClick } />
  36. );
  37. };
  38. export default translate(connect()(ConnectionStatusButton));