|
1 | | -import React from 'react' |
| 1 | +// import Modal from '@/components'; |
| 2 | +import DeleteModal from '@/components/DeleteModal'; |
| 3 | +import { useState } from 'react'; |
2 | 4 |
|
3 | 5 | const MyPage = () => { |
| 6 | + const [isOpen, setIsOpen] = useState(false); |
| 7 | + const [selectedItem, setSelectedItem] = useState(''); |
| 8 | + |
| 9 | + const openDeleteModal = (name: string) => { |
| 10 | + setSelectedItem(name); |
| 11 | + setIsOpen(true); |
| 12 | + }; |
| 13 | + |
| 14 | + const handleDelete = () => { |
| 15 | + setIsOpen(false); |
| 16 | + }; |
| 17 | + |
4 | 18 | return ( |
5 | | - <div> |
6 | | - 마이페이지 |
| 19 | + <div className="flex flex-col justify-center mt-10 px-20.5"> |
| 20 | + <h1 className="text-[42px] font-bold text-black">마이페이지</h1> |
| 21 | + <section className="w-full mt-10.5 mb-20"> |
| 22 | + <h2 className="mb-6 font-medium text-[24px] text-secondary-900">완료한 프로젝트</h2> |
| 23 | + <div className="overflow-hidden border border-neutral-30"> |
| 24 | + <table className="w-full text-sm text-left bg-white"> |
| 25 | + <thead className="text-black border-b-neutral-30 bg-neutral-10"> |
| 26 | + <tr className="whitespace-nowrap"> |
| 27 | + <th className="p-4">프로젝트명</th> |
| 28 | + <th className="p-4 w-30">역할</th> |
| 29 | + <th className="p-4 w-30">시작일</th> |
| 30 | + <th className="p-4 w-30">종료일</th> |
| 31 | + <th className="w-20 p-4"></th> |
| 32 | + </tr> |
| 33 | + </thead> |
| 34 | + <tbody> |
| 35 | + <tr className="font-medium text-black whitespace-nowrap"> |
| 36 | + <td className="p-4">와이어프레임 제작</td> |
| 37 | + <td className="p-4">기획, PPT</td> |
| 38 | + <td className="p-4">2025.11.13</td> |
| 39 | + <td className="p-4">2025.11.24</td> |
| 40 | + <td |
| 41 | + className="p-4 text-right cursor-pointer text-primary-500" |
| 42 | + onClick={() => openDeleteModal('와이어프레임 제작')} |
| 43 | + > |
| 44 | + 삭제 |
| 45 | + </td> |
| 46 | + </tr> |
| 47 | + </tbody> |
| 48 | + </table> |
| 49 | + </div> |
| 50 | + </section> |
| 51 | + <section className="w-full mt-10.5"> |
| 52 | + <h2 className="mb-6 font-medium text-[24px] text-secondary-900">나의 회고</h2> |
| 53 | + <div className="overflow-hidden border border-neutral-30"> |
| 54 | + <table className="w-full text-sm text-left bg-white"> |
| 55 | + <thead className="text-black border-b-neutral-30 bg-neutral-10"> |
| 56 | + <tr className="whitespace-nowrap"> |
| 57 | + <th className="p-4">제목</th> |
| 58 | + <th className="p-4 w-30">만든 날짜</th> |
| 59 | + <th className="w-20 p-4"></th> |
| 60 | + </tr> |
| 61 | + </thead> |
| 62 | + <tbody> |
| 63 | + <tr className="font-medium text-black whitespace-nowrap border-b-neutral-30"> |
| 64 | + <td className="p-4">회고1</td> |
| 65 | + <td className="p-4">2025.11.30</td> |
| 66 | + <td |
| 67 | + className="p-4 text-right cursor-pointer text-primary-500" |
| 68 | + onClick={() => openDeleteModal('회고1')} |
| 69 | + > |
| 70 | + 삭제 |
| 71 | + </td> |
| 72 | + </tr> |
| 73 | + <tr className="font-medium text-black whitespace-nowrap border-b-neutral-30"> |
| 74 | + <td className="p-4">회고2</td> |
| 75 | + <td className="p-4">2025.11.30</td> |
| 76 | + <td |
| 77 | + className="p-4 text-right cursor-pointer text-primary-500" |
| 78 | + onClick={() => openDeleteModal('회고2')} |
| 79 | + > |
| 80 | + 삭제 |
| 81 | + </td> |
| 82 | + </tr> |
| 83 | + </tbody> |
| 84 | + </table> |
| 85 | + </div> |
| 86 | + </section> |
| 87 | + <h2 className="mt-20 text-[24px] text-primary-500 font-bold">로그아웃</h2> |
| 88 | + |
| 89 | + <DeleteModal |
| 90 | + isOpen={isOpen} |
| 91 | + onClose={() => setIsOpen(false)} |
| 92 | + onConfirm={handleDelete} |
| 93 | + title="항목 삭제" |
| 94 | + description={`선택하신 "${selectedItem}" 항목을 영구적으로 삭제할까요?`} |
| 95 | + ></DeleteModal> |
7 | 96 | </div> |
8 | | - ) |
9 | | -} |
| 97 | + ); |
| 98 | +}; |
10 | 99 |
|
11 | | -export default MyPage |
| 100 | +export default MyPage; |
0 commit comments