From 2d2895c9a45979d3acc9e13a83d35ff8d35227cc Mon Sep 17 00:00:00 2001 From: gahusb Date: Tue, 26 May 2026 08:32:35 +0900 Subject: [PATCH] =?UTF-8?q?feat(saju):=20=EC=82=AC=EC=A3=BC=ED=92=80?= =?UTF-8?q?=EC=9D=B4=20=EA=B2=B0=EA=B3=BC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?(4=EA=B8=B0=EB=91=A5=20+=20=EC=98=A4=ED=96=89=20+=2012=EA=B0=9C?= =?UTF-8?q?=EC=9B=94=20+=20AI=2012=ED=95=AD=EB=AA=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/saju/SajuResult.jsx | 138 +++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 3 deletions(-) diff --git a/src/pages/saju/SajuResult.jsx b/src/pages/saju/SajuResult.jsx index a37bac5..f878bc7 100644 --- a/src/pages/saju/SajuResult.jsx +++ b/src/pages/saju/SajuResult.jsx @@ -1,10 +1,142 @@ import React from 'react'; +import { useSearchParams, Link } from 'react-router-dom'; +import './Saju.css'; +import SajuNav from './components/SajuNav'; +import HoryungMascot from './components/HoryungMascot'; +import SajuPillars from './components/SajuPillars'; +import ElementBarChart from './components/ElementBarChart'; +import InterpretAccordion from './components/InterpretAccordion'; +import HoryungQuote from './components/HoryungQuote'; +import MonthlyFlow from './components/MonthlyFlow'; +import useSajuReading from './hooks/useSajuReading'; export default function SajuResult() { + const [params] = useSearchParams(); + const rid = params.get('rid'); + const ridNum = rid ? parseInt(rid, 10) : null; + const { data, loading, error } = useSajuReading(ridNum); + + if (!rid) { + return ( +
+ +
+ +

사주 정보가 없어요

+

먼저 메인 페이지에서 사주를 입력해주세요.

+ 메인으로 가기 +
+
+ ); + } + + if (loading) { + return ( +
+ +
+ +

호령이 사주를 풀어보는 중...

+
+
+ ); + } + + if (error || !data) { + return ( +
+ +
+

사주 결과를 찾을 수 없어요

+

{error || '다시 입력해주세요.'}

+ 메인으로 가기 +
+
+ ); + } + + const saju = data.saju_data; + const analysis = data.analysis_data; + const interp = data.interpretation_json; + const monthlyFlow = data.monthly_flow; + return ( -
-

사주 분석 결과

-

UI 시안 적용 대기 중...

+
+ + +
+
+ +
+
+

사주풀이

+

+ {data.birth_year}년 {data.birth_month}월 {data.birth_day}일 + {data.birth_hour !== null ? ` ${data.birth_hour}시` : ' (시간 미상)'} ·{' '} + {data.gender === 'male' ? '남' : '여'} ·{' '} + {data.calendar_type === 'lunar' ? '음력' : '양력'} +

+ {interp?.summary && ( + + )} +
+
+ +
+
+

사주 4기둥

+ +
+ +
+

오행 분석

+ +
+ + {analysis?.day_master_strength && ( +
+

일간 강도

+
+

+ {analysis.day_master_strength.result} · 점수 {analysis.day_master_strength.score}
+ {(analysis.day_master_strength.reasons || []).join(' · ')} +

+
+
+ )} + + {monthlyFlow && ( +
+

12개월 운세 흐름

+ +
+ )} + + {interp?.items && ( +
+

AI 12항목 해석

+ +
+ )} + + {interp?.advice && ( +
+

호령의 조언

+ +
+ )} +
+ +
+ + + 오늘의 운세 + + + 📖 + 새 사주 보기 + +
); }