frontPanel/src/pages/Questions/QuestionSwitchWindowTool.tsx

26 lines
950 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";
import { useUiTools } from "@root/uiTools/store";
2023-11-29 15:45:15 +00:00
export const QuestionSwitchWindowTool = () => {
const {questions} = useQuestionsStore.getState()
const {openBranchingPanel} = useUiTools()
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down(600));
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>
)
}