import { useState } from "react";
import { useParams } from "react-router-dom";
import { Box, Typography, Tooltip, useTheme } from "@mui/material";
import { useDebouncedCallback } from "use-debounce";
import CustomTextField from "@ui_kit/CustomTextField";
import ButtonsOptions from "../ButtonsOptions";
import SwitchTextField from "./switchTextField";
import { questionStore, updateQuestionsList } from "@root/questions";
import InfoIcon from "../../../assets/icons/InfoIcon";
interface Props {
totalIndex: number;
}
export default function OwnTextField({ totalIndex }: Props) {
const [switchState, setSwitchState] = useState("setting");
const quizId = Number(useParams().quizId);
const { listQuestions } = questionStore();
const theme = useTheme();
const debounced = useDebouncedCallback((value) => {
const clonContent = listQuestions[quizId][totalIndex].content;
clonContent.placeholder = value;
updateQuestionsList(quizId, totalIndex, { content: clonContent });
}, 1000);
const SSHC = (data: string) => {
setSwitchState(data);
};
return (
<>
debounced(target.value)}
/>
Пользователю будет дано поле для ввода значения{" "}
>
);
}