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

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

Jiwon Yoon's avatar
Jiwon Yoon committed
11
12
13
14
15
export const QEssay = ({
  element,
  QuestionListChange,
  changeCurrentId,
}: Props) => {
16
17
  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
18
      <div className="flex h-16 w-full place-content-between items-center">
Jiwon Yoon's avatar
Jiwon Yoon committed
19
20
        <input
          type="text"
Jiwon Yoon's avatar
Jiwon Yoon committed
21
22
          name="title"
          id={element.id}
Jiwon Yoon's avatar
Jiwon Yoon committed
23
24
25
26
          className="text-xl font-bold ml-6 border-b-2 w-1/2"
          placeholder={element.title}
          onChange={QuestionListChange}
        ></input>
27
28
        <select
          id="Questions"
Jiwon Yoon's avatar
Jiwon Yoon committed
29
          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"
30
31
        >
          <option>질문종류</option>
Jiwon Yoon's avatar
Jiwon Yoon committed
32
          <option value="essay" selected>
33
34
            주관식
          </option>
Jiwon Yoon's avatar
Jiwon Yoon committed
35
36
37
38
39
40
41
          <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>
42
43
        </select>
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
44
45
46
      <div className="flex w-full justify-center">
        <input
          type="text"
Jiwon Yoon's avatar
Jiwon Yoon committed
47
48
          name="comment"
          id={element.id}
Jiwon Yoon's avatar
Jiwon Yoon committed
49
          className="border w-11/12"
50
          placeholder="질문에 대한 설명을 입력해주세요"
Jiwon Yoon's avatar
Jiwon Yoon committed
51
52
          onChange={QuestionListChange}
        ></input>
53
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
54
55
      <div id="commentarea" className="flex mt-4 w-full justify-center">
        <input className="border w-11/12 h-16" disabled></input>
56
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
57
      <div className="flex w-full justify-end py-2">
58
        <button className="w-1/12">필수</button>
Jiwon Yoon's avatar
Jiwon Yoon committed
59
        <button className="w-1/12">옵션</button>
60
        <button className="w-1/12">삭제</button>
Jiwon Yoon's avatar
Jiwon Yoon committed
61
        <Edit id={element.id} changeCurrentId={changeCurrentId} />
62
63
64
65
      </div>
    </div>
  );
};