diff --git a/src/components/dashboard/main/CompleteSection.tsx b/src/components/dashboard/main/CompleteSection.tsx new file mode 100644 index 0000000..8f2a0f9 --- /dev/null +++ b/src/components/dashboard/main/CompleteSection.tsx @@ -0,0 +1,150 @@ +import { useState } from "react"; +import { Icon } from "@iconify/react"; + +interface CompletedSectionProps { + applications?: any[]; + onCompanyClick?: (application: any) => void; +} + +const MOCK_COMPLETED_DATA = [ + { + id: "mock-1", + company: "쿠팡", + status: "불합격", + jobType: "데이터 경력", + jobTitle: "데이터 분석가", + resultDate: "2026-04-10", + fileName: "2026_쿠팡_데이터_경력", + } +]; + +export default function CompletedSection({ + applications = [], + onCompanyClick = () => {} +}: CompletedSectionProps) { + const [isOpen, setIsOpen] = useState(true); + + const [viewMode, setViewMode] = useState<"file" | "grid">("grid"); + + const realCompletedApps = applications.filter( + (app) => app.status === "COMPLETED" || app.status === "완료" || app.status === "불합격" + ); + + const displayApps = realCompletedApps.length > 0 ? realCompletedApps : MOCK_COMPLETED_DATA; + + return ( +
+ +
setIsOpen(!isOpen)} + className={`flex justify-between items-center px-6 py-4 cursor-pointer hover:bg-gray-50 transition-colors select-none ${ + isOpen ? "border-b border-gray-100" : "" + }`} + > +
+ +

완료된 공고

+ + {displayApps.length}건 + +
+ +
e.stopPropagation()} + > + + + +
+
+ + {isOpen && ( +
+ {displayApps.length === 0 ? ( +
+ +

완료된 공고가 없습니다.

+
+ ) : viewMode === "grid" ? ( + +
+ {displayApps.map((app) => ( +
onCompanyClick(app)} + className="bg-white p-5 rounded-2xl border border-gray-200/80 shadow-sm hover:shadow-md transition-all cursor-pointer flex flex-col justify-between h-40 group" + > +
+
+

+ {app.company} +

+ + {app.status} + +
+

{app.jobType}

+

{app.jobTitle}

+
+
+ 결과 확인일 {app.resultDate} +
+
+ ))} +
+ ) : ( + +
+ {displayApps.map((app) => ( +
onCompanyClick(app)} + className="flex flex-col items-center text-center cursor-pointer group max-w-[100px]" + > +
+ +
+ + + {app.fileName || `${app.resultDate.split('-')[0]}_${app.company}_${app.jobType}`} + +
+ ))} +
+ )} +
+ )} +
+ ); +} \ No newline at end of file diff --git a/src/screens/MainScreen.tsx b/src/screens/MainScreen.tsx index 4e8a8d3..331120e 100644 --- a/src/screens/MainScreen.tsx +++ b/src/screens/MainScreen.tsx @@ -9,6 +9,7 @@ import PostRegistration from "../components/modal/PostRegistration"; import ApplicationDetailModal from "../components/modal/ApplicationDetailModal"; import DocumentSection from "../components/dashboard/main/document/DocumentSection"; import ApplicationTable from "../components/dashboard/main/applicationTable/ApplicationTable"; +import CompletedSection from "../components/dashboard/main/CompleteSection"; import { Icon } from "@iconify/react"; export default function MainScreen() { @@ -91,15 +92,6 @@ export default function MainScreen() { <>
- - {!isSidebarOpen && ( - - )}
@@ -123,6 +115,11 @@ export default function MainScreen() { />
+ + )} @@ -136,11 +133,23 @@ export default function MainScreen() { {user && (
-
+ + +
); -} +} \ No newline at end of file