import { useParams } from "react-router-dom"; import { Box, Typography } from "@mui/material"; import ButtonsOptions from "../ButtonsOptions"; import React from "react"; import CustomTextField from "@ui_kit/CustomTextField"; import SwitchSlider from "./switchSlider"; import { questionStore, updateQuestionsList } from "@root/questions"; interface Props { totalIndex: number; } export default function SliderOptions({ totalIndex }: Props) { const [switchState, setSwitchState] = React.useState("setting"); const quizId = Number(useParams().quizId); const { listQuestions } = questionStore(); const SSHC = (data: string) => { setSwitchState(data); }; return ( <> Выбор значения из диапазона { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.range = `${target.value}—${ listQuestions[quizId][totalIndex].content.range.split("—")[1] }`; updateQuestionsList(quizId, totalIndex, { content: clonContent, }); }} /> { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.range = `${ listQuestions[quizId][totalIndex].content.range.split("—")[0] }—${target.value}`; updateQuestionsList(quizId, totalIndex, { content: clonContent, }); }} /> Начальное значение { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.start = Number(target.value); updateQuestionsList(quizId, totalIndex, { content: clonContent, }); }} /> Шаг { const clonContent = listQuestions[quizId][totalIndex].content; clonContent.step = Number(target.value); updateQuestionsList(quizId, totalIndex, { content: clonContent, }); }} /> ); }