import {Box, IconButton, Paper} from "@mui/material"; import CustomTextField from "@ui_kit/CustomTextField"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; import OneIcon from "@icons/questionsPage/OneIcon"; import PointsIcon from "@icons/questionsPage/PointsIcon"; import TypeQuestions from "./TypeQuestions"; import SwitchQuestionsPage from "./SwitchQuestionsPage"; import React, {useState} from "react"; import DeleteIcon from "@icons/questionsPage/deleteIcon"; import {useParams} from "react-router-dom"; import {questionStore} from "@root/questions"; interface Props { switchState: string; SSHC: (data: string) => void; DeleteClick: () => void; totalIndex: number } export default function QuestionsPageCard({ SSHC, switchState, totalIndex }: Props) { const params = Number(useParams().quizId); const {listQuestions, updateQuestionsList, createQuestion, removeQuestion} = questionStore() const [isExpanded, setIsExpanded] = useState(false); return ( {updateQuestionsList(params, totalIndex, {title: e.target.value}) console.log(listQuestions[params][totalIndex].title) } }/> setIsExpanded((prev) => !prev)}> {" "} {isExpanded ? : } {isExpanded && ( {switchState.length === 0 ? : } ) } ) }