import { Box, Typography, useTheme } from "@mui/material"; import CustomTextField from "@ui_kit/CustomTextField"; import { Answer, useQuizViewStore } from "@stores/quizView"; import { useQuizSettings } from "@contexts/QuizDataContext"; import { useRootContainerSize } from "@contexts/RootContainerWidthContext"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useMemo, type ChangeEvent } from "react"; import type { QuizQuestionText } from "@model/questionTypes/text"; interface TextNormalProps { currentQuestion: QuizQuestionText; answer?: Answer; stepNumber?: number | null; } export const TextNormal = ({ currentQuestion, answer }: TextNormalProps) => { const { settings } = useQuizSettings(); const { updateAnswer } = useQuizViewStore((state) => state); const isMobile = useRootContainerSize() < 650; const isTablet = useRootContainerSize() < 850; const theme = useTheme(); const onInputChange = async ({ target }: ChangeEvent) => { updateAnswer(currentQuestion.id, target.value, 0); }; const choiceImgUrlQuestion = useMemo(() => { if ( currentQuestion.content.editedUrlImagesList !== undefined && currentQuestion.content.editedUrlImagesList !== null ) { return currentQuestion.content.editedUrlImagesList[isMobile ? "mobile" : isTablet ? "tablet" : "desktop"]; } else { return currentQuestion.content.back; } }, [currentQuestion]); let isCrutch23022025 = window.location.pathname === "/bf8cae3a-e150-479d-befa-7f264087b223"; return ( {currentQuestion.title} {choiceImgUrlQuestion && choiceImgUrlQuestion !== " " && choiceImgUrlQuestion !== null && ( event.preventDefault()} > )} ); };