import React, { useState } from "react"; import { BasicQuestionType, EssayType } from "../types"; import { EssayForm } from "./EssayForm"; type Props = { element: BasicQuestionType; }; export const Question = ({ element }: Props) => { const handleClick = () => {}; const typeDD = new Map([ ["essay", "주관식"], ["radio", "객관식"], ["dropdown", "드롭다운(객관식)"], ["checkbox", "체크박스"], ["file", "파일"], ["rating", "선형"], ["grid", "그리드"], ["date", "날짜"], ]); function changeDD(e: React.ChangeEvent) { const tt = e.target.value; // questionTypeChange(e); console.log(tt); //if문으로 type별로 content 바뀌게 해보기 } function getContent(element: BasicQuestionType) { switch (element.type) { case "essay": return ; case "radio": // return ; case "checkbox": // return ; case "dropdown": // return ; case "file": // return ; case "rating": // return ; default: return <>; } } return (
{getContent(element)}
); };