import { Box, Typography, Button } from "@mui/material"; import { useQuestionsStore } from "@root/quizData/store" import type { QuizQuestionResult } from "@model/questionTypes/result"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe" type ResultFormProps = { currentQuestion: any; showContactForm: boolean; setShowContactForm: (show: boolean) => void; setShowResultForm: (show: boolean) => void; }; export const ResultForm = ({ currentQuestion, showContactForm, setShowContactForm, setShowResultForm, }: ResultFormProps) => { const { settings, items } = useQuestionsStore() const resultQuestion = items.find( (question) => question.type === "result" && (question.content.rule.parentId === "line" || currentQuestion.id) ); const followNextForm = () => { setShowResultForm(false); setShowContactForm(true); }; if (resultQuestion === null || resultQuestion === undefined) { followNextForm() return <> } else { return ( { //@ts-ignore !resultQuestion?.content.useImage && //@ts-ignore resultQuestion.content.video && } { //@ts-ignore resultQuestion?.content.useImage && resultQuestion.content.back && } {resultQuestion.description !== "" && resultQuestion.description !== " " && {resultQuestion.description}} {resultQuestion.title || "Форма результатов"} { settings?.cfg.resultInfo.when === "before" && } ); } };