import { useState } from "react"; import { useParams } from "react-router-dom"; import { Box, Typography, Popper, Grow, Paper, MenuList, MenuItem, ClickAwayListener, Modal, Button, useTheme, } from "@mui/material"; import { questionStore, updateQuestionsList, removeQuestionForce, createQuestion, } from "@root/questions"; import { BUTTON_TYPE_QUESTIONS } from "../TypeQuestions"; import type { RefObject } from "react"; import type { QuizQuestionType, QuizQuestionBase, } from "../../../model/questionTypes/shared"; type ChooseAnswerModalProps = { open: boolean; onClose: () => void; anchorRef: RefObject; totalIndex: number; switchState: string; }; export const ChooseAnswerModal = ({ open, onClose, anchorRef, totalIndex, switchState, }: ChooseAnswerModalProps) => { const [openModal, setOpenModal] = useState(false); const [selectedValue, setSelectedValue] = useState("text"); const quizId = Number(useParams().quizId); const { listQuestions } = questionStore(); const theme = useTheme(); return ( <> {({ TransitionProps }) => ( {BUTTON_TYPE_QUESTIONS.map(({ icon, title, value }) => ( { onClose(); setOpenModal(true); setSelectedValue(value); }, })} > {icon} {title} ))} )} setOpenModal(false)}> Все настройки, кроме заголовка вопроса будут сброшены ); };