2023-09-15 12:37:12 +00:00
|
|
|
|
import * as React from "react";
|
2023-06-30 14:39:07 +00:00
|
|
|
|
import StepOne from "../pages/startPage/stepOne";
|
|
|
|
|
import Steptwo from "../pages/startPage/steptwo";
|
|
|
|
|
import StartPageSettings from "../pages/startPage/StartPageSettings";
|
|
|
|
|
import QuestionsPage from "../pages/Questions/QuestionsPage";
|
2023-10-10 13:33:21 +00:00
|
|
|
|
import FormQuestionsPage from "../pages/Questions/Form/FormQuestionsPage";
|
2023-07-01 23:33:35 +00:00
|
|
|
|
import ContactFormPage from "../pages/ContactFormPage/ContactFormPage";
|
2023-07-06 15:54:12 +00:00
|
|
|
|
import InstallQuiz from "../pages/InstallQuiz/InstallQuiz";
|
2023-09-15 12:37:12 +00:00
|
|
|
|
import { Result } from "../pages/Result/Result";
|
|
|
|
|
import { Setting } from "../pages/Result/Setting";
|
2023-10-19 15:14:07 +00:00
|
|
|
|
import { QuestionsMap } from "../pages/QuestionsMap";
|
2023-03-03 20:07:19 +00:00
|
|
|
|
|
2023-03-03 23:54:19 +00:00
|
|
|
|
interface Props {
|
2023-09-15 12:37:12 +00:00
|
|
|
|
activeStep: number;
|
2023-10-05 10:12:56 +00:00
|
|
|
|
quizType: string;
|
|
|
|
|
startpage: string;
|
|
|
|
|
createResult: boolean;
|
2023-03-03 23:54:19 +00:00
|
|
|
|
}
|
2023-03-03 20:07:19 +00:00
|
|
|
|
|
2023-10-05 10:12:56 +00:00
|
|
|
|
export default function SwitchStepPages({
|
|
|
|
|
activeStep = 1,
|
|
|
|
|
quizType,
|
|
|
|
|
startpage,
|
|
|
|
|
createResult,
|
|
|
|
|
}: Props) {
|
2023-09-15 12:37:12 +00:00
|
|
|
|
switch (activeStep) {
|
|
|
|
|
case 1:
|
2023-10-05 10:12:56 +00:00
|
|
|
|
if (!quizType) return <StepOne />;
|
|
|
|
|
if (!startpage) return <Steptwo />;
|
|
|
|
|
return <StartPageSettings />;
|
2023-09-15 12:37:12 +00:00
|
|
|
|
case 2:
|
2023-10-10 13:33:21 +00:00
|
|
|
|
if (quizType === "form") return <FormQuestionsPage />;
|
2023-09-15 12:37:12 +00:00
|
|
|
|
return <QuestionsPage />;
|
2023-10-05 10:12:56 +00:00
|
|
|
|
case 3:
|
|
|
|
|
if (!createResult) return <Result />;
|
2023-09-15 12:37:12 +00:00
|
|
|
|
return <Setting />;
|
2023-10-05 10:12:56 +00:00
|
|
|
|
case 4:
|
2023-10-19 15:14:07 +00:00
|
|
|
|
return <QuestionsMap />;
|
2023-10-05 10:12:56 +00:00
|
|
|
|
case 5:
|
2023-10-19 15:14:07 +00:00
|
|
|
|
return <ContactFormPage />;
|
2023-10-05 10:12:56 +00:00
|
|
|
|
case 6:
|
2023-10-19 15:14:07 +00:00
|
|
|
|
return <InstallQuiz />;
|
|
|
|
|
case 7:
|
2023-10-05 10:12:56 +00:00
|
|
|
|
return <>Реклама</>;
|
|
|
|
|
|
2023-09-15 12:37:12 +00:00
|
|
|
|
default:
|
|
|
|
|
return <></>;
|
|
|
|
|
}
|
|
|
|
|
}
|