/* @flow */ import React from 'react'; import TimeElapsed from './TimeElapsed'; /** * The type of the React {@code Component} props of {@link SpeakerStatsItem}. */ type Props = { /** * The name of the participant. */ displayName: string, /** * The object that has as keys the facial expressions of the * participant and as values a number that represents the count . */ facialExpressions: Object, /** * True if the client width is les than 750. */ reduceExpressions: boolean, /** * True if the facial recognition is not disabled. */ showFacialExpressions: boolean, /** * The total milliseconds the participant has been dominant speaker. */ dominantSpeakerTime: number, /** * The id of the user. */ participantId: string, /** * True if the participant is no longer in the meeting. */ hasLeft: boolean, /** * True if the participant is currently the dominant speaker. */ isDominantSpeaker: boolean, /** * Invoked to obtain translated strings. */ t: Function }; const SpeakerStatsItem = (props: Props) => { /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ const hasLeftClass = props.hasLeft ? 'status-user-left' : ''; const rowDisplayClass = `speaker-stats-item ${hasLeftClass}`; const dotClass = props.isDominantSpeaker ? 'status-active' : 'status-inactive'; const speakerStatusClass = `speaker-stats-item__status-dot ${dotClass}`; return (
{ props.displayName }
{ props.showFacialExpressions && ( <>
{ props.facialExpressions.happy }
{ props.facialExpressions.neutral }
{ props.facialExpressions.sad }
{ props.facialExpressions.surprised }
{ !props.reduceExpressions && ( <>
{ props.facialExpressions.angry }
{ props.facialExpressions.fearful }
{ props.facialExpressions.disgusted }
)} ) }
); }; export default SpeakerStatsItem;