Commit 81684249 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

질문 타입 상수로 공유

parent 4d2e3d2b
export const QUESTION_TYPES = new Map([
["essay", "주관식"],
["radio", "객관식"],
["dropdown", "드롭다운"],
["checkbox", "체크박스"],
["file", "파일"],
["rating", "선형"],
["grid", "그리드"],
["date", "날짜"],
]);
export { Header } from "./Header";
export { QUESTION_TYPES } from "./constants";
import React, { useState, Dispatch, SetStateAction } from "react";
import { BasicQuestionType, EssayType } from "../types";
import React, { useState } from "react";
import { BasicQuestionType } from "../types";
import { questionApi } from "../apis";
import { EssayForm } from "./EssayForm";
import { CheckboxForm } from "./CheckboxForm";
......@@ -8,6 +8,7 @@ import { DropdownForm } from "./DropdownForm";
import { FileForm } from "./FileForm";
import { RatingForm } from "./RatingForm";
import { DateForm } from "./DateForm";
import { QUESTION_TYPES } from "../commons";
type Props = {
element: BasicQuestionType;
......@@ -15,17 +16,6 @@ type Props = {
deleteQuestion: (id: string) => void;
};
const typeDropDown = new Map([
["essay", "주관식"],
["radio", "객관식"],
["dropdown", "드롭다운"],
["checkbox", "체크박스"],
["file", "파일"],
["rating", "선형"],
["grid", "그리드"],
["date", "날짜"],
]);
export const Question = ({
element,
handleQuestion,
......@@ -165,7 +155,7 @@ export const Question = ({
disabled={save}
className="w-36 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-themeColor w-full mr-3 p-2.5"
>
{Array.from(typeDropDown.entries()).map(([key, value]) => (
{Array.from(QUESTION_TYPES.entries()).map(([key, value]) => (
<option
key={key}
id={element._id}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment