/* @flow */ import React, { Component } from 'react'; import { translate } from '../../../base/i18n'; import { Tooltip } from '../../../base/tooltip'; import { FACIAL_EXPRESSION_EMOJIS } from '../../../facial-recognition/constants.js'; /** * The type of the React {@code Component} props of {@link SpeakerStatsLabels}. */ type Props = { /** * True if the client width is les than 750. */ reduceExpressions: boolean, /** * True if the facial recognition is not disabled. */ showFacialExpressions: boolean, /** * The function to translate human-readable text. */ t: Function }; /** * React component for labeling speaker stats column items. * * @augments Component */ class SpeakerStatsLabels extends Component { /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { const { t } = this.props; return (
{ t('speakerStats.name') }
{ t('speakerStats.speakerTime') }
{ this.props.showFacialExpressions && (this.props.reduceExpressions ? Object.keys(FACIAL_EXPRESSION_EMOJIS) .filter(expression => ![ 'angry', 'fearful', 'disgusted' ].includes(expression)) : Object.keys(FACIAL_EXPRESSION_EMOJIS) ).map( expression => (
{ FACIAL_EXPRESSION_EMOJIS[expression] }
)) }
); } } export default translate(SpeakerStatsLabels);