Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

SpeakerStatsLabels.tsx 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { Theme } from '@mui/material';
  2. import React from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { makeStyles } from 'tss-react/mui';
  5. import { withPixelLineHeight } from '../../../base/styles/functions.web';
  6. // eslint-disable-next-line lines-around-comment
  7. // @ts-ignore
  8. import { Tooltip } from '../../../base/tooltip';
  9. import { FACE_EXPRESSIONS_EMOJIS } from '../../../face-landmarks/constants';
  10. const useStyles = makeStyles()((theme: Theme) => {
  11. return {
  12. labels: {
  13. padding: '22px 0 7px 0',
  14. height: 20
  15. },
  16. emojis: {
  17. paddingLeft: 27,
  18. ...withPixelLineHeight(theme.typography.bodyShortRegularLarge)
  19. }
  20. };
  21. });
  22. /**
  23. * The type of the React {@code Component} props of {@link SpeakerStatsLabels}.
  24. */
  25. type Props = {
  26. /**
  27. * True if the face expressions detection is not disabled.
  28. */
  29. showFaceExpressions: boolean;
  30. };
  31. const SpeakerStatsLabels = (props: Props) => {
  32. const { t } = useTranslation();
  33. const { classes } = useStyles();
  34. const nameTimeClass = `name-time${
  35. props.showFaceExpressions ? ' name-time_expressions-on' : ''
  36. }`;
  37. return (
  38. <div className = { `row ${classes.labels}` }>
  39. <div className = 'avatar' />
  40. <div className = { nameTimeClass }>
  41. <div>
  42. { t('speakerStats.name') }
  43. </div>
  44. <div>
  45. { t('speakerStats.speakerTime') }
  46. </div>
  47. </div>
  48. {
  49. props.showFaceExpressions
  50. && <div className = { `expressions ${classes.emojis}` }>
  51. {Object.keys(FACE_EXPRESSIONS_EMOJIS).map(
  52. expression => (
  53. <div
  54. className = 'expression'
  55. key = { expression }>
  56. <Tooltip
  57. content = { t(`speakerStats.${expression}`) }
  58. position = { 'top' } >
  59. <div>
  60. {FACE_EXPRESSIONS_EMOJIS[expression as keyof typeof FACE_EXPRESSIONS_EMOJIS]}
  61. </div>
  62. </Tooltip>
  63. </div>
  64. )
  65. )}
  66. </div>
  67. }
  68. </div>
  69. );
  70. };
  71. export default SpeakerStatsLabels;