QEssay.tsx 1.6 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 { useQuestion } from "./question.context";
Jiwon Yoon's avatar
Jiwon Yoon committed
4
import { Edit } from "./Edit";
5
import { TypeChange } from "./typeDD";
6
7
8
9
10

type Props = {
  element: EssayType;
};

Jiwon Yoon's avatar
Jiwon Yoon committed
11
12
13
export const QEssay = ({ element }: Props) => {
  const { questionListChange } = useQuestion();

14
15
  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
16
      <div className="flex h-16 w-full place-content-between items-center">
Jiwon Yoon's avatar
Jiwon Yoon committed
17
18
        <input
          type="text"
Jiwon Yoon's avatar
Jiwon Yoon committed
19
          name="title"
Jiwon Yoon's avatar
Jiwon Yoon committed
20
          id={element._id}
Jiwon Yoon's avatar
Jiwon Yoon committed
21
22
          className="text-xl font-bold ml-6 border-b-2 w-1/2"
          placeholder={element.title}
Jiwon Yoon's avatar
Jiwon Yoon committed
23
          onChange={questionListChange}
Jiwon Yoon's avatar
Jiwon Yoon committed
24
        ></input>
25
26
        {/* <TypeChange tt={"essay"} id={element._id} /> */}
        <TypeChange tt={"essay"} />
27
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
28
29
30
      <div className="flex w-full justify-center">
        <input
          type="text"
Jiwon Yoon's avatar
Jiwon Yoon committed
31
          name="comment"
Jiwon Yoon's avatar
Jiwon Yoon committed
32
          id={element._id}
Jiwon Yoon's avatar
Jiwon Yoon committed
33
          className="border w-11/12"
34
          placeholder="질문에 대한 설명을 입력해주세요"
Jiwon Yoon's avatar
Jiwon Yoon committed
35
          onChange={questionListChange}
Jiwon Yoon's avatar
Jiwon Yoon committed
36
        ></input>
37
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
38
39
      <div id="commentarea" className="flex mt-4 w-full justify-center">
        <input className="border w-11/12 h-16" disabled></input>
40
      </div>
Jiwon Yoon's avatar
Jiwon Yoon committed
41
      <div className="flex w-full justify-end py-2">
42
        <button className="w-1/12">필수</button>
Jiwon Yoon's avatar
Jiwon Yoon committed
43
        <button className="w-1/12">옵션</button>
44
        <button className="w-1/12">삭제</button>
Jiwon Yoon's avatar
Jiwon Yoon committed
45
        <Edit id={element._id} />
46
47
48
49
      </div>
    </div>
  );
};