import { Box, FormControl, FormControlLabel, Radio, RadioGroup, Typography, useTheme, } from "@mui/material"; import CustomCheckbox from "@ui_kit/CustomCheckbox"; import { questionStore, updateQuestionsList } from "@root/questions"; import InfoIcon from "../../../assets/icons/InfoIcon"; import type { QuestionType } from "@root/questions"; type SettingTextFieldProps = { totalIndex: number; }; type Answer = { name: string; value: QuestionType; }; const ANSWER_TYPES: Answer[] = [ { name: "Односточное", value: "single" }, { name: "Многострочное", value: "multi" }, { name: "Только числа", value: "number" }, ]; export default function SettingTextField({ totalIndex, }: SettingTextFieldProps) { const { listQuestions } = questionStore(); const theme = useTheme(); return ( Настройки ответов value === listQuestions[totalIndex].content.type )} onChange={({ target }: React.ChangeEvent) => { const clonContent = listQuestions[totalIndex].content; clonContent.type = ANSWER_TYPES[Number(target.value)].value; updateQuestionsList(totalIndex, { content: clonContent }); }} > {ANSWER_TYPES.map(({ name }, index) => ( } label={name} /> ))} Настройки вопросов ); }