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.

TranscribingLabel.web.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import { translate } from '../../base/i18n/index';
  5. import { CircularLabel } from '../../base/label/index';
  6. import Tooltip from '@atlaskit/tooltip';
  7. /**
  8. * The type of the React {@code Component} props of {@link TranscribingLabel}.
  9. */
  10. type Props = {
  11. /**
  12. * Invoked to obtain translated strings.
  13. */
  14. t: Function,
  15. /**
  16. * Boolean value indicating current transcribing status
  17. */
  18. _transcribing: boolean
  19. };
  20. /**
  21. * React Component for displaying a label when a transcriber is in the
  22. * conference.
  23. *
  24. * @extends Component
  25. */
  26. class TranscribingLabel extends Component<Props> {
  27. /**
  28. * Implements React's {@link Component#render()}.
  29. *
  30. * @inheritdoc
  31. * @returns {ReactElement}
  32. */
  33. render() {
  34. if (!this.props._transcribing) {
  35. return null;
  36. }
  37. return (
  38. <Tooltip
  39. content = { this.props.t('transcribing.labelToolTip') }
  40. position = { 'left' }>
  41. <CircularLabel
  42. className = 'recording-label'
  43. label = { this.props.t('transcribing.tr') } />
  44. </Tooltip>
  45. );
  46. }
  47. }
  48. /**
  49. * Maps (parts of) the Redux state to the associated props for the
  50. * {@code TranscribingLabel} component.
  51. *
  52. * @param {Object} state - The Redux state.
  53. * @private
  54. * @returns {{
  55. * }}
  56. */
  57. function _mapStateToProps(state) {
  58. const { isTranscribing } = state['features/transcribing'];
  59. return {
  60. _transcribing: isTranscribing
  61. };
  62. }
  63. export default translate(connect(_mapStateToProps)(TranscribingLabel));