frontend/containers/Profile/ContentSwitch.tsx (view raw)
1import Switch from '@mui/material/Switch';
2import Typography from '@mui/material/Typography';
3
4const ContentSwitch = ({
5 isEditing,
6 checked,
7 onChange,
8 trueLabel,
9 falseLabel,
10 t,
11}) => {
12 return isEditing ? (
13 <Switch checked={checked} onChange={onChange} />
14 ) : (
15 <Typography variant="h6" fontWeight="bold" py={1}>
16 {checked ? t(trueLabel) : t(falseLabel)}
17 </Typography>
18 );
19};
20
21export default ContentSwitch;