Skip to content

Commit d5f95cf

Browse files
authored
Merge pull request #30 from HeartForecast/feat/#29
AI 피드백 페이지 구현
2 parents 3517c3d + 66b31c2 commit d5f95cf

File tree

4 files changed

+862
-6
lines changed

4 files changed

+862
-6
lines changed

app/components/EmotionResultPopup.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,29 @@ export default function EmotionResultPopup({ isVisible, onClose, emotions }: Emo
239239
</motion.div>
240240
</motion.div>
241241

242-
{/* 종료 버튼 */}
242+
{/* 버튼 */}
243243
<div className="absolute bottom-20 left-1/2 transform -translate-x-1/2">
244244
<button
245-
onClick={handleClose}
246-
className="bg-white bg-opacity-20 hover:bg-opacity-30 text-black font-medium py-3 px-6 rounded-full transition-all duration-300 backdrop-blur-sm border border-white border-opacity-30"
245+
onClick={() => {
246+
// 감정 데이터를 URL 파라미터로 전달하여 피드백 페이지로 이동
247+
const emotionData = emotions.map(emotion => ({
248+
timeSlot: emotion.step === 'afternoon' ? 'lunch' : emotion.step === 'evening' ? 'dinner' : 'morning',
249+
forecastEmotion: emotion.emotion.name, // 실제로는 예보 데이터가 필요하지만 현재는 기록 데이터 사용
250+
actualEmotion: emotion.emotion.name,
251+
actualEmotionImage: emotion.emotion.image,
252+
memo: emotion.memo
253+
}));
254+
255+
const dataParam = encodeURIComponent(JSON.stringify({
256+
emotionData,
257+
aiFeedback: null // AI가 생성할 예정
258+
}));
259+
260+
router.push(`/feedback?data=${dataParam}`);
261+
}}
262+
className="bg-[#FF6F71] hover:bg-[#FF5A5C] text-white font-medium py-3 px-6 rounded-full transition-all duration-300 shadow-lg"
247263
>
248-
돌아가기
264+
감정 이야기 듣기
249265
</button>
250266
</div>
251267
</motion.div>

0 commit comments

Comments
 (0)