import React, { useState } from "react"; import { BasicQuestionType } from "./CreateSurveyFormPage"; import { QEssay } from "./QEssay"; import { QCheckbox } from "./QCheckbox"; import { QRadio } from "./QRadio"; import { QDropdown } from "./QDropdown"; import { QFile } from "./QFile"; import { QRating } from "./QRating"; type Props = { questionList: BasicQuestionType[]; QuestionListChange: (e: React.ChangeEvent) => void; addQuestion: () => void; }; export const Question = ({ questionList, QuestionListChange, addQuestion, }: Props) => { return ( <> {console.log(questionList)} {questionList.map((element) => { switch (element.type) { case "essay": return ( ); case "radio": return ( ); case "checkbox": return ( ); case "dropdown": return ( ); case "file": return ( ); case "rating": return ( ); default: break; } })}
); };