From 35188c7b52bb336eabad14033d0f1e8853a5786c Mon Sep 17 00:00:00 2001 From: corpi Date: Fri, 13 Feb 2026 11:42:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A7=80=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=20=ED=99=94=EB=A9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/debrief/page.tsx | 118 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 src/app/debrief/page.tsx diff --git a/src/app/debrief/page.tsx b/src/app/debrief/page.tsx new file mode 100644 index 0000000..91c7823 --- /dev/null +++ b/src/app/debrief/page.tsx @@ -0,0 +1,118 @@ +'use client'; + +import { useEffect, useState } from 'react'; +import { useRouter } from 'next/navigation'; +import { getCurrentVoyage, saveToHistory, saveCurrentVoyage } from '@/lib/store'; +import { Voyage, VoyageStatus } from '@/types'; + +export default function DebriefPage() { + const router = useRouter(); + const [voyage, setVoyage] = useState(null); + + const [status, setStatus] = useState(null); + const [progress, setProgress] = useState(''); + const [nextAction, setNextAction] = useState(''); + + useEffect(() => { + const current = getCurrentVoyage(); + if (!current) { + router.replace('/'); + return; + } + setVoyage(current); + }, [router]); + + const handleSave = () => { + if (!voyage || !status) return; + + const finalVoyage: Voyage = { + ...voyage, + status: status, + debriefProgress: progress, + nextAction: nextAction, + endedAt: voyage.endedAt || Date.now(), // Fallback if missed in flight + }; + + saveToHistory(finalVoyage); + saveCurrentVoyage(null); + router.push('/log'); + }; + + if (!voyage) return null; + + const statusOptions: { value: VoyageStatus; label: string; desc: string }[] = [ + { value: 'completed', label: '✅ 계획대로', desc: '목표를 달성했습니다' }, + { value: 'partial', label: '🌓 부분 진행', desc: '절반의 성공입니다' }, + { value: 'reoriented', label: '🧭 방향 재설정', desc: '새로운 발견을 했습니다' }, + ]; + + return ( +
+
+

무사히 궤도에 도착했습니다

+

이번 항해를 짧게 기록하고 마무리하세요.

+
+ +
+ {/* Question 1: Status */} +
+ +
+ {statusOptions.map((opt) => ( + + ))} +
+
+ + {/* Question 2: Secured */} +
+ + setProgress(e.target.value)} + placeholder="예: 기획안 목차 구성 완료" + className="w-full bg-slate-900/30 border border-slate-800 rounded-lg px-4 py-3 text-slate-200 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none transition-all" + /> +
+ + {/* Question 3: Next Action */} +
+ + setNextAction(e.target.value)} + placeholder="예: 본문 1챕터 초안 쓰기" + className="w-full bg-slate-900/30 border border-slate-800 rounded-lg px-4 py-3 text-slate-200 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 outline-none transition-all" + /> +
+
+ + +
+ ); +}