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

37 lines
922 B
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";
export const BranchingMap = () => {
const quiz = useCurrentQuiz();
const { dragQuestionId } = useQuestionsStore()
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 />
:
<FirstNodeField />
}
</Box>
);
};