import { Box } from "@mui/material"; import { reorderQuestions } from "@root/questions/actions"; import type { DropResult } from "react-beautiful-dnd"; import { DragDropContext, Droppable } from "react-beautiful-dnd"; import DraggableListItem from "./DraggableListItem"; import { useQuestionsStore } from "@root/questions/store"; export const DraggableList = () => { const { questions } = useQuestionsStore() const filteredQuestions = questions.filter((question) => question.type !== "result") const onDragEnd = ({ destination, source }: DropResult) => { if (destination) reorderQuestions(source.index, destination.index); }; return ( {(provided, snapshot) => ( {filteredQuestions.map((question, index) => ( ))} {provided.placeholder} )} ); };