import { useEffect } from "react"; import { Box, Button, Link, Typography, useTheme } from "@mui/material"; import { useQuizViewStore } from "@/stores/quizView"; import { useRootContainerSize } from "@contexts/RootContainerWidthContext"; import { useQuizSettings } from "@contexts/QuizDataContext"; import { useVkMetricsGoals } from "@/utils/hooks/metrics/useVkMetricsGoals"; import { useYandexMetricsGoals } from "@/utils/hooks/metrics/useYandexMetricsGoals"; import { DESIGN_LIST } from "@/utils/designList"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; import { NameplateLogo } from "@icons/NameplateLogo"; import type { QuizQuestionResult } from "@/model/questionTypes/result"; type ResultFormProps = { resultQuestion: QuizQuestionResult; }; export const ResultForm = ({ resultQuestion }: ResultFormProps) => { const theme = useTheme(); const isMobile = useRootContainerSize() < 650; const isTablet = useRootContainerSize() < 1000; const { settings, show_badge, quizId } = useQuizSettings(); const setCurrentQuizStep = useQuizViewStore((state) => state.setCurrentQuizStep); const spec = settings.cfg.spec; const vkMetrics = useVkMetricsGoals(settings.cfg.vkMetricsNumber); const yandexMetrics = useYandexMetricsGoals(settings.cfg.yandexMetricsNumber); useEffect(() => { vkMetrics.resultIdShown(resultQuestion.id); yandexMetrics.resultIdShown(resultQuestion.id); }, [resultQuestion.id, vkMetrics, yandexMetrics]); return ( Ваш результат: {!resultQuestion?.content.useImage && resultQuestion.content.video && ( )} {resultQuestion?.content.useImage && resultQuestion.content.back && ( resultImage )} {resultQuestion.description !== "" && resultQuestion.description !== " " && ( {resultQuestion.description} )} {resultQuestion.title} {resultQuestion.content.text !== "" && resultQuestion.content.text !== " " && ( {resultQuestion.content.text} )} {show_badge && ( )} {settings.cfg.resultInfo.showResultForm === "before" && settings.cfg.showfc !== false && !settings.cfg.score && ( )} {settings.cfg.resultInfo.showResultForm === "after" && resultQuestion.content.redirect && ( )} ); };