-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProjectList.js
42 lines (38 loc) · 1.34 KB
/
ProjectList.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React, { useEffect, useState } from "react";
import { keyboard } from "@testing-library/user-event/dist/keyboard";
const ProjectList = ({ list, pageType, setPageType }) => {
const getThirdDivText = () => {
if (pageType === "selling_register" || pageType === "demand_register") {
return "등록일";
} else if (pageType === "selling_order") {
return "제출일";
} else {
return "---"; // 기본값 설정
}
};
return (
<div className="List">
<div className="list_space">
<div className="header">
<div className="first">번호</div>
<div className="second">프로젝트 제목</div>
<div className="third">{getThirdDivText()}</div>
<div className="last">비고</div>
</div>
{list.map((list, index) => {
const orderDate = new Date(list.createdtime);
const formattedDate = orderDate.toISOString().split("T")[0];
return (
<div className="content" key={list.id}>
<div className="order_num">{index + 1}</div>
<div className="order_title">{list.name}</div>
<div className="order_date">{formattedDate}</div>
<div className="order_memo">{list.status}</div>
</div>
);
})}
</div>
</div>
);
};
export default ProjectList;