import { memo } from "react"; import { useParams } from "react-router-dom"; import { Draggable } from "react-beautiful-dnd"; import { Box, ListItem, Typography, useTheme } from "@mui/material"; import QuestionsPageCard from "./QuestionPageCard"; import { updateQuestionsList } from "@root/questions"; import { QuizQuestionBase } from "../../../model/questionTypes/shared"; type DraggableListItemProps = { index: number; isDragging: boolean; questionData: QuizQuestionBase; }; export default memo( ({ index, isDragging, questionData }: DraggableListItemProps) => { const quizId = Number(useParams().quizId); const theme = useTheme(); console.log("Мой индекс " + index); console.log(questionData); return ( {(provided) => ( {questionData.deleted ? ( Вопрос удалён. { updateQuestionsList(quizId, index, { ...questionData, deleted: false, }); }} sx={{ cursor: "pointer", fontSize: "16px", textDecoration: "underline", color: theme.palette.brightPurple.main, textDecorationColor: theme.palette.brightPurple.main, }} > Восстановить? ) : ( )} )} ); } );