You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FaceExpressionsSwitch.tsx 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. import Switch from '../../../base/ui/components/web/Switch';
  7. const useStyles = makeStyles()((theme: Theme) => {
  8. return {
  9. switchContainer: {
  10. display: 'flex',
  11. alignItems: 'center'
  12. },
  13. switchLabel: {
  14. marginRight: 10,
  15. ...withPixelLineHeight(theme.typography.bodyShortRegular)
  16. }
  17. };
  18. });
  19. /**
  20. * The type of the React {@code Component} props of {@link ToggleFaceExpressionsButton}.
  21. */
  22. interface IProps {
  23. /**
  24. * The function to initiate the change in the speaker stats table.
  25. */
  26. onChange: (checked?: boolean) => void;
  27. /**
  28. * The state of the button.
  29. */
  30. showFaceExpressions: boolean;
  31. }
  32. /**
  33. * React component for toggling face expressions grid.
  34. *
  35. * @returns {React$Element<any>}
  36. */
  37. export default function FaceExpressionsSwitch({ onChange, showFaceExpressions }: IProps) {
  38. const { classes } = useStyles();
  39. const { t } = useTranslation();
  40. return (
  41. <div className = { classes.switchContainer } >
  42. <label
  43. className = { classes.switchLabel }
  44. htmlFor = 'face-expressions-switch'>
  45. { t('speakerStats.displayEmotions')}
  46. </label>
  47. <Switch
  48. checked = { showFaceExpressions }
  49. id = 'face-expressions-switch'
  50. onChange = { onChange } />
  51. </div>
  52. );
  53. }