frontPanel/src/pages/Questions/QuestionSwitchWindowTool.tsx

25 lines
915 B
TypeScript
Raw Normal View History

2023-11-29 15:45:15 +00:00
import {
Box, useMediaQuery, useTheme,
} from "@mui/material";
2023-11-29 15:45:15 +00:00
import { DraggableList } from "./DraggableList";
import { SwitchBranchingPanel } from "./SwitchBranchingPanel";
2023-11-29 15:45:15 +00:00
import { BranchingMap } from "./BranchingMap";
import {useQuestionsStore} from "@root/questions/store";
2023-11-29 15:45:15 +00:00
export const QuestionSwitchWindowTool = () => {
const {openBranchingPanel, questions} = useQuestionsStore.getState()
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(600));
console.log("questions ", questions)
2023-11-29 15:45:15 +00:00
return (
<Box sx={{ display: "flex", gap: "20px", flexWrap: "wrap", marginBottom: isMobile ? "20px" : undefined }}>
2023-11-29 15:45:15 +00:00
<Box sx={{ flexBasis: "796px" }}>
{openBranchingPanel? <BranchingMap /> : <DraggableList />}
2023-11-29 15:45:15 +00:00
</Box>
<SwitchBranchingPanel
2023-11-29 15:45:15 +00:00
/>
</Box>
)
}