QFile.tsx 2.11 KB
Newer Older
Jiwon Yoon's avatar
Jiwon Yoon committed
1
import React, { useState } from "react";
Jiwon Yoon's avatar
Jiwon Yoon committed
2
import { FileType } from "./CreateSurveyFormPage";
Jiwon Yoon's avatar
Jiwon Yoon committed
3
import { useQuestion } from "./question.context";
Jiwon Yoon's avatar
Jiwon Yoon committed
4
5
6
7
8

type Props = {
  element: FileType;
};

Jiwon Yoon's avatar
Jiwon Yoon committed
9
10
11
export const QFile = ({ element }: Props) => {
  const { questionListChange } = useQuestion();

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