50 lines
1.4 KiB
TypeScript
Executable File
50 lines
1.4 KiB
TypeScript
Executable File
import * as React from "react";
|
||
import StepOne from "../pages/startPage/stepOne";
|
||
import Steptwo from "../pages/startPage/steptwo";
|
||
import StartPageSettings from "../pages/startPage/StartPageSettings";
|
||
import QuestionsPage from "../pages/Questions/QuestionsPage";
|
||
import FormQuestionsPage from "../pages/Questions/Form/FormQuestionsPage";
|
||
import ContactFormPage from "../pages/ContactFormPage/ContactFormPage";
|
||
import InstallQuiz from "../pages/InstallQuiz/InstallQuiz";
|
||
import { Result } from "../pages/Result/Result";
|
||
import { Setting } from "../pages/Result/Setting";
|
||
import { QuestionsMap } from "../pages/QuestionsMap";
|
||
|
||
interface Props {
|
||
activeStep: number;
|
||
quizType: string;
|
||
startpage: string;
|
||
createResult: boolean;
|
||
}
|
||
|
||
export default function SwitchStepPages({
|
||
activeStep = 1,
|
||
quizType,
|
||
startpage,
|
||
createResult,
|
||
}: Props) {
|
||
switch (activeStep) {
|
||
case 1:
|
||
if (!quizType) return <StepOne />;
|
||
if (!startpage) return <Steptwo />;
|
||
return <StartPageSettings />;
|
||
case 2:
|
||
if (quizType === "form") return <FormQuestionsPage />;
|
||
return <QuestionsPage />;
|
||
case 3:
|
||
if (!createResult) return <Result />;
|
||
return <Setting />;
|
||
case 4:
|
||
return <QuestionsMap />;
|
||
case 5:
|
||
return <ContactFormPage />;
|
||
case 6:
|
||
return <InstallQuiz />;
|
||
case 7:
|
||
return <>Реклама</>;
|
||
|
||
default:
|
||
return <></>;
|
||
}
|
||
}
|