frontPanel/src/pages/Questions/BranchingMap/index.tsx

39 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-11-29 15:45:15 +00:00
import { Box } from "@mui/material";
import { FirstNodeField } from "./FirstNodeField";
import { CsComponent } from "./CsComponent";
import { useQuestionsStore } from "@root/questions/store"
import { useCurrentQuiz } from "@root/quizes/hooks";
2023-12-01 08:12:59 +00:00
import { useState } from "react";
2023-11-29 15:45:15 +00:00
export const BranchingMap = () => {
const quiz = useCurrentQuiz();
const { dragQuestionId } = useQuestionsStore()
2023-12-01 08:12:59 +00:00
const [openedModalQuestionsId, setOpenedModalQuestionsId] = useState<string>()
2023-11-29 15:45:15 +00:00
return (
<Box
id="cytoscape-container"
sx={{
overflow: "hidden",
padding: "20px",
background: "#FFFFFF",
borderRadius: "12px",
boxShadow: "0px 8px 24px rgba(210, 208, 225, 0.4)",
marginBottom: "40px",
height: "521px",
border: dragQuestionId === null ? "none" : "#7e2aea 2px dashed"
}}
>
{
quiz?.config.haveRoot ?
<CsComponent />
:
2023-12-01 08:12:59 +00:00
<FirstNodeField setOpenedModalQuestionsId={setOpenedModalQuestionsId} />
2023-11-29 15:45:15 +00:00
}
</Box>
);
};