import { Box, Skeleton, useMediaQuery, useTheme } from "@mui/material"; import { deleteTimeoutedQuestions } from "@utils/deleteTimeoutedQuestions"; import { lazy, Suspense, useCallback } from "react"; import { DraggableList } from "./DraggableList"; import { SwitchBranchingPanel } from "./SwitchBranchingPanel"; const BranchingMap = lazy(() => import("./BranchingMap").then((module) => ({ default: module.BranchingMap })), ); interface Props { openBranchingPage: boolean; setOpenBranchingPage: (a: boolean) => void; widthMain: number; } export const QuestionSwitchWindowTool = ({ openBranchingPage, setOpenBranchingPage, widthMain, }: Props) => { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(600)); const isTablet = useMediaQuery(theme.breakpoints.down(1000)); const openBranchingPageHC = useCallback(() => { if (!openBranchingPage) { deleteTimeoutedQuestions(); } setOpenBranchingPage(!openBranchingPage); }, [openBranchingPage, setOpenBranchingPage]); return ( {openBranchingPage ? ( } > ) : ( )} {openBranchingPage && ( )} ); };