EvalueTonSavoir/client/src/components/LaunchQuizDialog/LaunchQuizDialog.tsx

61 lines
1.9 KiB
TypeScript
Raw Normal View History

import React from 'react';
2024-03-29 20:08:34 -04:00
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogTitle,
FormControl,
FormControlLabel,
FormLabel,
Radio,
RadioGroup
} from '@mui/material';
interface Props {
open: boolean;
handleOnClose: () => void;
launchQuiz: () => void;
setQuizMode: (mode: 'teacher' | 'student') => void;
}
const LaunchQuizDialog: React.FC<Props> = ({ open, handleOnClose, launchQuiz, setQuizMode }) => {
return (
<Dialog open={open} onClose={handleOnClose}>
<DialogTitle sx={{ fontWeight: 'bold', fontSize: 24 }}>
Options de lancement du quiz
</DialogTitle>
<DialogContent>
<FormControl>
<FormLabel>Rythme du quiz</FormLabel>
<RadioGroup defaultValue="teacher" name="radio-buttons-group">
<FormControlLabel
value="teacher"
control={<Radio />}
label="Rythme du professeur"
onChange={() => setQuizMode('teacher')}
/>
<FormControlLabel
value="student"
control={<Radio />}
label="Rythme de l'étudiant"
onChange={() => setQuizMode('student')}
/>
</RadioGroup>
</FormControl>
</DialogContent>
<DialogActions>
<Button variant="outlined" onClick={handleOnClose}>
<div>Annuler</div>
2024-03-29 20:08:34 -04:00
</Button>
<Button variant="contained" onClick={launchQuiz}>
<div>Lancer</div>
2024-03-29 20:08:34 -04:00
</Button>
</DialogActions>
</Dialog>
);
};
export default LaunchQuizDialog;