import { Box, Typography, Button } from "@mui/material"; import { getQuestionByContentId } from "@root/questions/actions"; import { useCurrentQuiz } from "@root/quizes/hooks"; import { useQuestionsStore } from "@root/questions/store"; import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared"; import YoutubeEmbedIframe from "../../ui_kit/StartPagePreview/YoutubeEmbedIframe.tsx"; import { NameplateLogo } from "@icons/NameplateLogo"; import { modes } from "../../utils/themes/Publication/themePublication"; type ResultFormProps = { currentQuestion: AnyTypedQuizQuestion; showContactForm: boolean; setShowContactForm: (show: boolean) => void; setShowResultForm: (show: boolean) => void; }; export const ResultForm = ({ currentQuestion, showContactForm, setShowContactForm, setShowResultForm, }: ResultFormProps) => { const quiz = useCurrentQuiz(); const mode = modes; const { questions } = useQuestionsStore(); const resultQuestion = (questions.find( (question) => question.type === "result" && question.content.rule.parentId === currentQuestion.content.id, ) || questions.find( (question) => question.type === "result" && question.content.rule.parentId === "line", )) as AnyTypedQuizQuestion; const followNextForm = () => { setShowResultForm(false); setShowContactForm(true); }; if (resultQuestion === undefined) return <>; return ( {!resultQuestion?.content.useImage && resultQuestion.content.video && ( )} {resultQuestion?.content.useImage && resultQuestion.content.back && ( )} {resultQuestion.description !== "" && resultQuestion.description !== " " && ( {resultQuestion.description} )} {resultQuestion.title || "Форма результатов"} {resultQuestion.content.text !== "" && resultQuestion.content.text !== " " && ( {resultQuestion.content.text} )} Сделано на PenaQuiz {quiz?.config.resultInfo.when === "before" && ( <> )} ); };