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 { questionStore, updateQuestionsList } from "@root/questions"; type DraggableListItemProps = { index: number; isDragging: boolean; }; export const DraggableListItem = ({ index, isDragging, }: DraggableListItemProps) => { const quizId = Number(useParams().quizId); const { listQuestions } = questionStore(); const theme = useTheme(); return ( {(provided) => ( {listQuestions[quizId][index].deleted ? ( Вопрос удалён. { updateQuestionsList(quizId, index, { ...listQuestions[quizId][index], deleted: false, }); }} sx={{ cursor: "pointer", fontSize: "16px", textDecoration: "underline", color: theme.palette.brightPurple.main, textDecorationColor: theme.palette.brightPurple.main, }} > Восстановить? ) : ( )} )} ); };