Files
o2o-infinith-demo/src/components/discovery/ActionPlanSection.tsx
T
Haewon KamandClaude Sonnet 5 890da0ecdf feat(discovery): 진단 리포트에서 개선 제안(Action Plan) 단계 분리
증거(진단)와 처방(할 일)을 한 페이지에 두면 스크롤이 너무 길어져
둘 다 읽기 힘들다는 지적에 따라 단계를 나눴다.

- /actions/:id 신규: Action Plan(P0~P2) + What We Don't Sell + 빌드 제안
  (ActionPlanSection·IntegritySection 신규 컴포넌트, Tag는 두 페이지가
  같이 써서 공용 컴포넌트로 뺌)
- /discovery/🆔 위 섹션 제거, 진단(점수·근거·Scorecard·Rubric)만 남김.
  페이지 맨 아래 중복으로 박혀 있던 확인 항목 패널(ClinicInputsPanel)도
  제거 — /supporters/:id 전용 단계가 이미 있어 두 번 보여줄 필요가 없었다
- 진단 데이터가 없는 병원이 /actions/:id 로 오면 /discovery/:id 로 되돌림
- ClinicNav: 5단계로 확장(진단 리포트→개선 제안→사이트 빌드→사진 확인→
  확인 항목), 다음 단계 플로팅 버튼 추가(기존엔 이전 단계만 있었다)
- App.tsx: 라우트 전환 시 스크롤을 맨 위로 되돌림. 스크롤을 내린 채
  다음 단계를 누르면 새 페이지가 같은 위치(짧으면 빈 하단)에서 시작하던
  문제 수정. 인앱 해시 앵커(#breakdown)가 있으면 건드리지 않음
- 사이트 빌드/확인 항목 화면의 미리보기 버튼을 "초안 사이트 열기"로
  통일(공개 후에는 "공개본 사이트 열기")

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 10:27:12 +09:00

68 lines
2.7 KiB
TypeScript

/**
* 개선 제안(/actions/:id) 1부: 우선순위별 실행 항목.
* 원래 진단 리포트 안의 "Action Plan" 섹션이었다. 진단(증거)과 처방(할 일)은 읽는 목적이 달라
* 별도 단계로 뗐다. 내용은 그대로다.
*/
import { motion } from 'motion/react';
import { SectionWrapper } from '../report/ui/SectionWrapper';
import { Tag } from './Tag';
import type { ActionPriority, DiscoveryResult } from '../../types/discovery';
const PRIORITY_STYLE: Record<ActionPriority, string> = {
P0: 'bg-[#FFF0F0] text-[#7C3A4B] border-[#F5D5DC]',
P1: 'bg-[#FFF6ED] text-[#7C5C3A] border-[#F5E0C5]',
P2: 'bg-[#F3F0FF] text-[#4A3A7C] border-[#D5CDF5]',
};
const PRIORITY_HEADING: Record<ActionPriority, string> = {
P0: '즉시: 크롤러 접근·엔티티·측정',
P1: '4주 내: 콘텐츠 구조',
P2: '지속: 신선도·시딩',
};
export function ActionPlanSection({ result }: { result: DiscoveryResult }) {
return (
<SectionWrapper
id="actions"
title="Action Plan"
subtitle="우선순위별 실행 항목. 각 항목이 어느 기준을 올리는지 연결"
>
<div className="space-y-4">
{(['P0', 'P1', 'P2'] as ActionPriority[]).map((p) => (
<div key={p}>
<div className="flex items-center gap-3 mb-3 mt-6 first:mt-0">
<span className={`inline-flex items-center rounded-full text-sm font-semibold px-3 py-1 border ${PRIORITY_STYLE[p]}`}>
{p}
</span>
<span className="text-lg font-bold text-[#0A1128]">{PRIORITY_HEADING[p]}</span>
</div>
<div className="grid md:grid-cols-2 gap-4">
{result.actions.filter((a) => a.priority === p).map((a, i) => (
<motion.div
key={a.title}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ delay: i * 0.08 }}
className="on-light bg-white rounded-2xl border border-slate-100 shadow-sm p-5"
>
<div className="flex items-start justify-between gap-3 mb-2">
<h4 className="font-bold text-[#0A1128]">{a.title}</h4>
<span className="ui-note shrink-0">{a.effort}</span>
</div>
<p className="ui-body mb-3">{a.detail}</p>
<div className="flex flex-wrap gap-1.5">
{a.criterionIds.map((cid) => (
<Tag key={cid}>{cid}</Tag>
))}
</div>
</motion.div>
))}
</div>
</div>
))}
</div>
</SectionWrapper>
);
}