QEssay.tsx 2.1 KB
Newer Older
1
import React, { useState } from "react";
Jiwon Yoon's avatar
Jiwon Yoon committed
2
import { EssayType } from "./CreateSurveyFormPage";
3
4
5

type Props = {
  element: EssayType;
Jiwon Yoon's avatar
Jiwon Yoon committed
6
  QuestionListChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
8
};

Jiwon Yoon's avatar
Jiwon Yoon committed
9
export const QEssay = ({ element, QuestionListChange }: Props) => {
10
11
  return (
    <div className="flex flex-col container w-4/5 h-auto border-2 border-themeColor items-center m-3 py-2">
Jiwon Yoon's avatar
Jiwon Yoon committed
12
      <div className="flex h-16 w-full place-content-between items-center">
Jiwon Yoon's avatar
Jiwon Yoon committed
13
14
        <input
          type="text"
Jiwon Yoon's avatar
Jiwon Yoon committed
15
16
          name="title"
          id={element.id}
Jiwon Yoon's avatar
Jiwon Yoon committed
17
18
19
20
          className="text-xl font-bold ml-6 border-b-2 w-1/2"
          placeholder={element.title}
          onChange={QuestionListChange}
        ></input>
21
22
        <select
          id="Questions"
Jiwon Yoon's avatar
Jiwon Yoon committed
23
          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"
24
25
        >
          <option>질문종류</option>
Jiwon Yoon's avatar
Jiwon Yoon committed
26
          <option value="essay" selected>
27
28
            주관식
          </option>
Jiwon Yoon's avatar
Jiwon Yoon committed
29
30
31
32
33
34
35
          <option value="radio">객관식</option>
          <option value="dropdown">드롭다운(객관식)</option>
          <option value="checkbox">체크박스(객관식)</option>
          <option value="file">파일업로드</option>
          <option value="rating">선형</option>
          <option value="grid">그리드</option>
          <option value="date">날짜</option>
36
37
        </select>
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
38
39
40
      <div className="flex w-full justify-center">
        <input
          type="text"
Jiwon Yoon's avatar
Jiwon Yoon committed
41
42
          name="comment"
          id={element.id}
Jiwon Yoon's avatar
Jiwon Yoon committed
43
          className="border w-11/12"
44
          placeholder="질문에 대한 설명을 입력해주세요"
Jiwon Yoon's avatar
Jiwon Yoon committed
45
46
          onChange={QuestionListChange}
        ></input>
47
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
48
49
      <div id="commentarea" className="flex mt-4 w-full justify-center">
        <input className="border w-11/12 h-16" disabled></input>
50
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
51
      <div className="flex w-full justify-end py-2">
52
        <button className="w-1/12">필수</button>
Jiwon Yoon's avatar
Jiwon Yoon committed
53
        <button className="w-1/12">옵션</button>
54
55
56
57
58
        <button className="w-1/12">삭제</button>
      </div>
    </div>
  );
};