import { useParams } from "react-router-dom"; import { Box, Button, Chip, FormControl, FormControlLabel, IconButton, Link, Modal, Radio, RadioGroup, Typography, useTheme, } from "@mui/material"; import { questionStore, resetSomeField, updateQuestionsList, } from "@root/questions"; import { Select } from "./Select"; import DeleteIcon from "@icons/questionsPage/deleteIcon"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; import InfoIcon from "@icons/Info"; type BranchingQuestionsProps = { totalIndex: number; }; const ACTIONS = ["Показать", "Скрыть"]; const STIPULATIONS = ["Условие 1", "Условие 2", "Условие 3"]; const ANSWERS = ["Ответ 1", "Ответ 2", "Ответ 3"]; const CONDITIONS = [ "Все условия обязательны", "Обязательно хотя бы одно условие", ]; export default function BranchingQuestions({ totalIndex, }: BranchingQuestionsProps) { const quizId = Number(useParams().quizId); const { openedModalSettings, listQuestions } = questionStore(); const theme = useTheme(); const handleClose = () => { resetSomeField({ openedModalSettings: "" }); }; return ( <> () { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.rule.reqs[index] = { id: String( STIPULATIONS.findIndex((item) => item.includes(stipulation) ) ), vars: request.vars, }; updateQuestionsList(quizId, totalIndex, { content: clonContent, }); }} sx={{ marginBottom: "15px" }} /> {request.id && ( <> Дан ответ (Укажите один или несколько вариантов)