import { Box } from "@mui/material"; import { useRootContainerSize } from "@contexts/RootContainerWidthContext"; import { notReachable } from "@utils/notReachable"; import type { QuizStartpageAlignType, QuizStartpageType, } from "@model/settingsData"; type StartPageDesktopProps = { quizHeaderBlock: JSX.Element; quizMainBlock: JSX.Element; backgroundBlock: JSX.Element | null; startpageType: QuizStartpageType; alignType: QuizStartpageAlignType; }; type LayoutProps = Omit; const StandartLayout = ({ alignType, quizHeaderBlock, quizMainBlock, backgroundBlock, }: LayoutProps) => ( {quizHeaderBlock} {quizMainBlock} {backgroundBlock} ); const ExpandedLayout = ({ alignType, quizHeaderBlock, quizMainBlock, backgroundBlock, }: LayoutProps) => ( {quizHeaderBlock} {quizMainBlock} {backgroundBlock} ); const CenteredLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock, }: LayoutProps) => { const isTablet = useRootContainerSize() < 1100; return ( {quizHeaderBlock} {backgroundBlock && ( img": { width: "100%", borderRadius: "12px" }, }} > {backgroundBlock} )} {quizMainBlock} ); }; export const StartPageDesktop = ({ quizHeaderBlock, quizMainBlock, backgroundBlock, startpageType, alignType, }: StartPageDesktopProps) => { switch (startpageType) { case null: case "standard": { return ( ); } case "expanded": { return ( ); } case "centered": { return ( ); } default: notReachable(startpageType); } };