import * as React from 'react';

import AnswerOptions from "./answerOptions/AnswerOptions";
import OptionsPicture from "./OptionsPicture/OptionsPicture";
import DataOptions from "./DataOptions/DataOptions";
import SliderOptions from "./SliderOptions/SliderOptions";
import OwnTextField from "./OwnTextField/OwnTextField";
import PageOptions from "./PageOptions/PageOptions";
import OptionsAndPicture from "./OptionsAndPicture/OptionsAndPicture";
import RatingOptions from "./RatingOptions/RatingOptions";
import Emoji from "./Emoji/Emoji";
import DropDown from "./DropDown/DropDown";
import UploadFile from "./UploadFile/UploadFile";

interface Props {
    switchState: string,
    // DeleteClick: () => void;
    totalIndex: number,
}

export default function SwitchQuestionsPage ({switchState = '', totalIndex }: Props) {
    switch (switchState) {
        case 'answer':
            return (<AnswerOptions totalIndex={totalIndex}/>);
            break;

        case 'answerpict':
            return (<OptionsPicture totalIndex={totalIndex}/>);
            break;

        case 'answerandpict':
            return (<OptionsAndPicture totalIndex={totalIndex}/>);
            break;

        case 'emoji':
            return (<Emoji totalIndex={totalIndex}/>);
            break;

        case 'textfield':
            return (<OwnTextField totalIndex={totalIndex}/>);
            break;

        case 'dropdown':
            return (<DropDown totalIndex={totalIndex}/>);
            break;

        case 'date':
            return (<DataOptions totalIndex={totalIndex}/>);
            break;

        case 'slider':
            return (<SliderOptions totalIndex={totalIndex}/>);
            break;

        case 'uploader':
            return (<UploadFile totalIndex={totalIndex}/>);
            break;

        case 'page':
            return (<PageOptions totalIndex={totalIndex}/>);
            break;

        case 'rating':
            return (<RatingOptions totalIndex={totalIndex}/>);
            break;

        default:
            return (<></>)
    }
}