import { useParams } from "react-router-dom"; import { Box, Button, IconButton, Typography } from "@mui/material"; import { ReactComponent as CheckedIcon } from "@icons/checked.svg"; import { useQuestionsStore } from "@root/questions/store"; import { updateDragQuestionContentId } from "@root/questions/actions"; import { useEffect } from "react"; import { AnyTypedQuizQuestion, UntypedQuizQuestion } from "@model/questionTypes/shared"; import { Pencil } from "../../startPage/Sidebar/icons/Pencil"; import {updateOpenBranchingPanel, updateEditSomeQuestion} from "@root/questions/actions" const getItemStyle = (isDragging: any, draggableStyle: any) => ({ // some basic styles to make the items look a bit nicer userSelect: "none", padding: 5 * 2, margin: `0 0 5px 0`, // change background colour if dragging background: isDragging ? "lightgreen" : "grey", // styles we need to apply on draggables ...draggableStyle }); type AnyQuestion = UntypedQuizQuestion | AnyTypedQuizQuestion export const QuestionsList = () => { const { desireToOpenABranchingModal } = useQuestionsStore() const trashQuestions = useQuestionsStore().questions const questions = trashQuestions.filter((question) => question.type !== "result") return ( Перетащите вопросы в карту ветвления {/* тут нужно будет фильтровать с проверкой, что вопрос имеет тип*/} {questions.filter((q: AnyQuestion) => q.type).map(({ title, content }, index) => ( ))} ); }