// screens/analysis.jsx — AI 진단 결과 (항목별 점수 + radar) function AnalysisScreen({ persona, setRoute }) { const Icons = window.Icons; const [overlay, setOverlay] = React.useState("pores"); const [showBaseline, setShowBaseline] = React.useState(true); const overlayOpts = [ { v: "pores", l: "모공" }, { v: "sebum", l: "유분/피지광" }, { v: "redness", l: "홍조" }, { v: "pigment", l: "색소" }, { v: "wrinkle", l: "주름/탄력" }, ]; const scores = persona.skinScores; const overall = Math.round(Object.values(scores).reduce((a, b) => a + b, 0) / Object.keys(scores).length); const baselineAvg = Math.round(Object.values(BASELINE_SCORES).reduce((a, b) => a + b, 0) / Object.keys(BASELINE_SCORES).length); const sortedKeys = [...SCORE_KEYS].sort((a, b) => scores[a] - scores[b]); // worst → best const worst3 = sortedKeys.slice(0, 3); const best3 = sortedKeys.slice(-3).reverse(); const TIME_STEPS = [ { l: "이미지 수집", t: "5장 · 12MB", done: true }, { l: "Region 분할", t: "8 영역", done: true }, { l: "지표 추출", t: "47 features", done: true }, { l: "점수화", t: "10 dimensions", done: true }, { l: "Cohort 매칭", t: "유사 환자 142", done: true }, ]; return (
03 · AI 진단 결과

피부 정량 분석 — {overall} / 100

10개 지표의 정량 분석 결과입니다. 막대 위 검은 마커는 동일 연령대 일반 기준 점수이며, 표준화된 cohort {persona.id === "P-2026-0489" ? "286" : "142"}명 데이터와 매칭되었습니다.

{/* Pipeline timeline */}
AI PIPELINE {TIME_STEPS.map((s, i) => (
{s.l}
{s.t}
{i < TIME_STEPS.length - 1 &&
} ))}
소요 2.4s
{/* LEFT — Face + heatmap */}

히트맵 — 영역별 분포

{/* Annotations */} {overlay === "pores" && ( <> )}
OVERLAY
{overlayOpts.find(o => o.v === overlay).l}
{/* Heatmap legend */}
LOW
HIGH
{/* Region cards */}
최우선 개선 영역
{worst3.map((k, i) => (
{String(i+1).padStart(2,"0")} {k} {scores[k]}점
))}
우수 영역
{best3.map((k, i) => (
{String(i+1).padStart(2,"0")} {k} {scores[k]}점
))}
{/* CENTER — Score chart */}

10대 지표 점수 (100점 만점)

{SCORE_KEYS.map((k, i) => { const v = scores[k]; const tone = v >= 80 ? "good" : v >= 65 ? "watch" : "alert"; return (
); })}
80+ 양호 65-79 <65 주의 일반 기준
{/* RIGHT — Radar + Overall */}
종합 피부 점수
{persona.skinAge}
피부 나이
{persona.skinType}
피부 타입
Top Concern
{persona.topConcern}
{persona.secondaryConcerns.join(" · ")}

Radar

scores[k])} baseline={SCORE_KEYS.map(k => BASELINE_SCORES[k])} size={240} color="var(--phase-tint)" />
); } window.AnalysisScreen = AnalysisScreen;