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 ( +
먼저 메인 페이지에서 사주를 입력해주세요.
+ 메인으로 가기 +호령이 사주를 풀어보는 중...
+{error || '다시 입력해주세요.'}
+ 메인으로 가기 +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 && ( +
+ {analysis.day_master_strength.result} · 점수 {analysis.day_master_strength.score}
+ {(analysis.day_master_strength.reasons || []).join(' · ')}
+