/* @flow */ import React from 'react'; import { Avatar, StatelessAvatar } from '../../../base/avatar'; import { getInitials } from '../../../base/avatar/functions'; import BaseTheme from '../../../base/ui/components/BaseTheme'; import { FACIAL_EXPRESSIONS } from '../../../facial-recognition/constants.js'; 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 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 not shown in speaker stats. */ hidden: boolean, /** * True if the participant is currently the dominant speaker. */ isDominantSpeaker: boolean, /** * Styles for the item. */ styles: Object, /** * Invoked to obtain translated strings. */ t: Function } const SpeakerStatsItem = (props: Props) => { const hasLeftClass = props.hasLeft ? props.styles.hasLeft : ''; const rowDisplayClass = `row ${hasLeftClass} ${props.styles.item}`; const expressionClass = 'expression'; const nameTimeClass = `name-time${ props.showFacialExpressions ? ' name-time_expressions-on' : '' }`; const timeClass = `${props.styles.time} ${props.isDominantSpeaker ? props.styles.dominant : ''}`; const FacialExpressions = () => FACIAL_EXPRESSIONS.map( expression => (
{ props.facialExpressions[expression] }
) ); return (
{ props.hasLeft ? ( ) : ( ) }
{ props.displayName }
{ props.showFacialExpressions && (
)}
); }; export default SpeakerStatsItem;