1+ "use client" ;
2+
3+ import { DoneItemDetail } from "@/components/mypage" ;
4+ import { useParams } from "next/navigation" ;
5+
6+ export default function DoneItemDetailPage ( ) {
7+ const params = useParams ( ) ;
8+ const goalId = params . id as string ;
9+
10+ // Mock data - in a real app, this would come from an API based on goalId
11+ const getGoalDetailById = ( id : string ) => {
12+ const goalDetails = {
13+ "1" : {
14+ id : "1" ,
15+ title : "해외로 취업하자!" ,
16+ subGoals : [
17+ {
18+ id : "1" ,
19+ title : "포트폴리오 및 이력서 준비하기" ,
20+ completedTodos : [
21+ {
22+ id : "1" ,
23+ title : "투두 리스트 타이틀이 들어갑니다." ,
24+ completedDate : "2025.05.12" ,
25+ attachment : {
26+ type : "image" as const ,
27+ url : "https://picsum.photos/200" ,
28+ } ,
29+ } ,
30+ {
31+ id : "2" ,
32+ title : "투두 리스트 타이틀이 들어갑니다." ,
33+ completedDate : "2025.05.12" ,
34+ attachment : {
35+ type : "file" as const ,
36+ url : "https://picsum.photos/200" ,
37+ name : "파일명이 여기에.pdf" ,
38+ } ,
39+ } ,
40+ {
41+ id : "3" ,
42+ title : "투두 리스트 타이틀이 들어갑니다." ,
43+ completedDate : "2025.05.12" ,
44+ } ,
45+ ] ,
46+ } ,
47+ {
48+ id : "2" ,
49+ title : "세부목표명이 여기에 들어갑니다." ,
50+ completedTodos : [
51+ {
52+ id : "4" ,
53+ title : "투두 리스트 타이틀이 들어갑니다." ,
54+ completedDate : "2025.05.12" ,
55+ attachment : {
56+ type : "image" as const ,
57+ url : "https://picsum.photos/200" ,
58+ } ,
59+ } ,
60+ {
61+ id : "5" ,
62+ title : "투두 리스트 타이틀이 들어갑니다." ,
63+ completedDate : "2025.05.12" ,
64+ } ,
65+ ] ,
66+ } ,
67+ ] ,
68+ } ,
69+ "2" : {
70+ id : "2" ,
71+ title : "건강한 생활 습관 만들기" ,
72+ subGoals : [
73+ {
74+ id : "3" ,
75+ title : "매일 운동하기" ,
76+ completedTodos : [
77+ {
78+ id : "6" ,
79+ title : "헬스장 등록하기" ,
80+ completedDate : "2025.03.01" ,
81+ } ,
82+ {
83+ id : "7" ,
84+ title : "운동 계획표 작성" ,
85+ completedDate : "2025.03.02" ,
86+ attachment : {
87+ type : "file" as const ,
88+ url : "/workout-plan.pdf" ,
89+ name : "운동계획표.pdf" ,
90+ } ,
91+ } ,
92+ ] ,
93+ } ,
94+ ] ,
95+ } ,
96+ } ;
97+
98+ return goalDetails [ id as keyof typeof goalDetails ] || goalDetails [ "1" ] ;
99+ } ;
100+
101+ const goalDetail = getGoalDetailById ( goalId ) ;
102+
103+ return < DoneItemDetail goalDetail = { goalDetail } /> ;
104+ }
0 commit comments