frontPanel/src/pages/ViewPublicationPage/ResultForm.tsx

34 lines
835 B
TypeScript
Raw Normal View History

2023-12-15 12:12:36 +00:00
import { Box, Typography, Button } from "@mui/material";
import { useCurrentQuiz } from "@root/quizes/hooks";
type ResultFormProps = {
showContactForm: boolean;
setShowContactForm: (show: boolean) => void;
setShowResultForm: (show: boolean) => void;
};
export const ResultForm = ({
showContactForm,
setShowContactForm,
setShowResultForm,
}: ResultFormProps) => {
const quiz = useCurrentQuiz();
const followNextForm = () => {
setShowResultForm(false);
setShowContactForm(true);
};
return (
<Box>
<Typography>Форма результатов</Typography>
{!showContactForm && quiz?.config.resultInfo.when !== "after" && (
<Button variant="contained" onClick={followNextForm}>
Показать форму контактов
</Button>
)}
</Box>
);
};