2021-12-28 14:35:21 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2022-09-13 07:36:00 +00:00
|
|
|
import { makeStyles } from 'tss-react/mui';
|
2018-10-30 05:02:23 +00:00
|
|
|
|
2022-09-13 07:36:00 +00:00
|
|
|
import { withPixelLineHeight } from '../../../base/styles/functions.web';
|
|
|
|
// eslint-disable-next-line lines-around-comment
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2021-11-10 17:49:53 +00:00
|
|
|
import { Tooltip } from '../../../base/tooltip';
|
2022-05-06 12:41:08 +00:00
|
|
|
import { FACE_EXPRESSIONS_EMOJIS } from '../../../face-landmarks/constants';
|
2017-02-17 00:59:30 +00:00
|
|
|
|
2022-11-15 07:50:22 +00:00
|
|
|
const useStyles = makeStyles()(theme => {
|
2021-12-28 14:35:21 +00:00
|
|
|
return {
|
|
|
|
labels: {
|
|
|
|
padding: '22px 0 7px 0',
|
|
|
|
height: 20
|
|
|
|
},
|
|
|
|
emojis: {
|
|
|
|
paddingLeft: 27,
|
2022-09-13 07:36:00 +00:00
|
|
|
...withPixelLineHeight(theme.typography.bodyShortRegularLarge)
|
2021-12-28 14:35:21 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2017-02-17 00:59:30 +00:00
|
|
|
/**
|
2018-10-30 05:02:23 +00:00
|
|
|
* The type of the React {@code Component} props of {@link SpeakerStatsLabels}.
|
2017-02-17 00:59:30 +00:00
|
|
|
*/
|
2022-11-03 08:35:51 +00:00
|
|
|
interface IProps {
|
2018-10-30 05:02:23 +00:00
|
|
|
|
2021-11-17 14:33:03 +00:00
|
|
|
/**
|
2022-04-06 09:10:31 +00:00
|
|
|
* True if the face expressions detection is not disabled.
|
2021-11-17 14:33:03 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
showFaceExpressions: boolean;
|
2022-11-03 08:35:51 +00:00
|
|
|
}
|
2017-02-17 00:59:30 +00:00
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
const SpeakerStatsLabels = (props: IProps) => {
|
2021-12-28 14:35:21 +00:00
|
|
|
const { t } = useTranslation();
|
2022-09-13 07:36:00 +00:00
|
|
|
const { classes } = useStyles();
|
2021-12-28 14:35:21 +00:00
|
|
|
const nameTimeClass = `name-time${
|
2022-04-06 09:10:31 +00:00
|
|
|
props.showFaceExpressions ? ' name-time_expressions-on' : ''
|
2021-12-28 14:35:21 +00:00
|
|
|
}`;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className = { `row ${classes.labels}` }>
|
|
|
|
<div className = 'avatar' />
|
|
|
|
|
|
|
|
<div className = { nameTimeClass }>
|
|
|
|
<div>
|
2017-02-17 00:59:30 +00:00
|
|
|
{ t('speakerStats.name') }
|
|
|
|
</div>
|
2021-12-28 14:35:21 +00:00
|
|
|
<div>
|
2017-02-17 00:59:30 +00:00
|
|
|
{ t('speakerStats.speakerTime') }
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-28 14:35:21 +00:00
|
|
|
{
|
2022-04-06 09:10:31 +00:00
|
|
|
props.showFaceExpressions
|
2021-12-28 14:35:21 +00:00
|
|
|
&& <div className = { `expressions ${classes.emojis}` }>
|
2022-08-25 11:35:19 +00:00
|
|
|
{Object.keys(FACE_EXPRESSIONS_EMOJIS).map(
|
|
|
|
expression => (
|
|
|
|
<div
|
|
|
|
className = 'expression'
|
|
|
|
key = { expression }>
|
|
|
|
<Tooltip
|
|
|
|
content = { t(`speakerStats.${expression}`) }
|
|
|
|
position = { 'top' } >
|
|
|
|
<div>
|
|
|
|
{FACE_EXPRESSIONS_EMOJIS[expression as keyof typeof FACE_EXPRESSIONS_EMOJIS]}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</Tooltip>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)}
|
2021-12-28 14:35:21 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2017-02-17 00:59:30 +00:00
|
|
|
|
2021-12-28 14:35:21 +00:00
|
|
|
export default SpeakerStatsLabels;
|