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" 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 { questions } = useQuestionsStore(); const resultQuestion = questions.find( (question) => question.type === "result" && (question.content.rule.parentId === "line" || currentQuestion.content.id) ); 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 || "Форма результатов"} { quiz?.config.resultInfo.when === "before" && } ); };