2022-09-13 07:36:00 +00:00
|
|
|
import { Theme } from '@mui/material';
|
2022-08-03 11:24:44 +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';
|
2022-08-03 11:24:44 +00:00
|
|
|
|
2022-09-13 07:36:00 +00:00
|
|
|
import { withPixelLineHeight } from '../../../base/styles/functions.web';
|
2022-08-03 11:24:44 +00:00
|
|
|
import Switch from '../../../base/ui/components/web/Switch';
|
|
|
|
|
2022-09-13 07:36:00 +00:00
|
|
|
const useStyles = makeStyles()((theme: Theme) => {
|
2022-08-03 11:24:44 +00:00
|
|
|
return {
|
|
|
|
switchContainer: {
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center'
|
|
|
|
},
|
|
|
|
|
|
|
|
switchLabel: {
|
|
|
|
marginRight: 10,
|
2022-09-13 07:36:00 +00:00
|
|
|
...withPixelLineHeight(theme.typography.bodyShortRegular)
|
2022-08-03 11:24:44 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link ToggleFaceExpressionsButton}.
|
|
|
|
*/
|
2022-11-03 08:35:51 +00:00
|
|
|
interface IProps {
|
2022-08-03 11:24:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The function to initiate the change in the speaker stats table.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onChange: (checked?: boolean) => void;
|
2022-08-03 11:24:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The state of the button.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
showFaceExpressions: boolean;
|
2022-08-03 11:24:44 +00:00
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
}
|
2022-08-03 11:24:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* React component for toggling face expressions grid.
|
|
|
|
*
|
|
|
|
* @returns {React$Element<any>}
|
|
|
|
*/
|
2022-11-03 08:35:51 +00:00
|
|
|
export default function FaceExpressionsSwitch({ onChange, showFaceExpressions }: IProps) {
|
2022-09-13 07:36:00 +00:00
|
|
|
const { classes } = useStyles();
|
2022-08-03 11:24:44 +00:00
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className = { classes.switchContainer } >
|
|
|
|
<label
|
|
|
|
className = { classes.switchLabel }
|
|
|
|
htmlFor = 'face-expressions-switch'>
|
|
|
|
{ t('speakerStats.displayEmotions')}
|
|
|
|
</label>
|
|
|
|
<Switch
|
|
|
|
checked = { showFaceExpressions }
|
|
|
|
id = 'face-expressions-switch'
|
|
|
|
onChange = { onChange } />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|