-
+ {strengths.map((s, i) => (
- {s} ))} +
-
+ {challenges.map((s, i) => (
- {s} ))} +
diff --git a/src/pages/saju/CompatibilityResult.jsx b/src/pages/saju/CompatibilityResult.jsx index c5c9056..721eb5a 100644 --- a/src/pages/saju/CompatibilityResult.jsx +++ b/src/pages/saju/CompatibilityResult.jsx @@ -1,10 +1,108 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; +import { useSearchParams, Link } from 'react-router-dom'; +import './_shell/tokens.css'; +import './_shell/shell.css'; +import useViewportMode from './_shell/useViewportMode'; +import BottomNav from './_shell/BottomNav'; +import DesktopHeader from './_shell/DesktopHeader'; +import TopRibbon from './_shell/TopRibbon'; +import TitleBlock from './_shell/TitleBlock'; +import Mascot from './_shell/Mascot'; +import MascotBubble from './_shell/MascotBubble'; +import OrnateFrame from './_shell/OrnateFrame'; +import PrimaryButton from './_shell/PrimaryButton'; +import GhostButton from './_shell/GhostButton'; +import { compatGetReading } from '../../api'; export default function CompatibilityResult() { + const mode = useViewportMode(); + const [params] = useSearchParams(); + const cid = params.get('cid'); + const [result, setResult] = useState(null); + const [error, setError] = useState(null); + + useEffect(() => { + if (!cid) return; + compatGetReading(parseInt(cid, 10)) + .then(setResult) + .catch((e) => setError(e?.message || '결과를 가져오지 못했어요.')); + }, [cid]); + + const interp = result?.interpretation_json || {}; + const strengths = interp.strengths || []; + const challenges = interp.challenges || []; + return ( -
UI 시안 적용 대기 중...
+