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

41 lines
1019 B
TypeScript
Raw Normal View History

2023-12-25 15:38:40 +00:00
import {
Box,
Typography,
Switch,
useTheme,
Button,
useMediaQuery,
} from "@mui/material";
import { QuestionsList } from "./QuestionsList";
import { PanelSwitchQuestionListGraph } from "@ui_kit/Toolbars/PanelSwitchQuestionListGraph";
interface Props {
openBranchingPage: boolean;
setOpenBranchingPage: () => void;
}
export const SwitchBranchingPanel = ({
openBranchingPage,
2023-12-31 02:53:25 +00:00
setOpenBranchingPage,
}: Props) => {
const theme = useTheme();
2023-12-25 15:38:40 +00:00
const isMobile = useMediaQuery(theme.breakpoints.down(660));
const isTablet = useMediaQuery(theme.breakpoints.down(1446));
return openBranchingPage ? (
<Box sx={{ userSelect: "none", maxWidth: "350px", width: "100%" }}>
{isTablet || (
<PanelSwitchQuestionListGraph
openBranchingPage={openBranchingPage}
setOpenBranchingPage={setOpenBranchingPage}
/>
)}
2023-12-31 02:53:25 +00:00
{openBranchingPage && (
<QuestionsList setOpenBranchingPage={setOpenBranchingPage} />
)}
</Box>
2023-12-25 15:38:40 +00:00
) : (
<></>
);
};