- 상품 정보: 가격 2행만 1차 강조, 거래 조건 4종은 구분선 아래 2×2 보조 그리드로 강등 - 가격 라운드: 행당 강조를 %(파랑) 하나로 — 카드 칩은 회색으로 - 엔진 판단: 현재 협상 카드를 패널 주인공으로 승격, 긴장도 구간명을 값에 병기해 라벨 행·설명 캡션 제거, 게이지·바 두께 축소 - 협상 진행: 완료 단계 라벨 감쇄 — 현재 단계만 강조 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UFZ7JWdwCaQAwNYJErL8pP
114 lines
4.8 KiB
TypeScript
114 lines
4.8 KiB
TypeScript
import { DIST_LABEL, PARTNER_LABEL, SCENARIO_QUADRANTS, type DemoCase } from '../content/cases'
|
|
|
|
export function CasePanel({
|
|
cases, selected, busy, onSelect, onChange,
|
|
}: {
|
|
cases: DemoCase[]
|
|
selected: DemoCase | null
|
|
busy: boolean
|
|
onSelect: (c: DemoCase) => void
|
|
onChange: () => void
|
|
}) {
|
|
if (!selected) {
|
|
return (
|
|
<section className="rounded-box bg-base-100 p-5">
|
|
<h2 className="text-[13px] font-semibold text-base-content/55">협상 케이스</h2>
|
|
<p className="mt-3 text-[13px] leading-relaxed text-base-content/50">
|
|
가운데 화면에서 시나리오를 선택하면 진행 중인 케이스와 상품 정보가
|
|
여기에 표시됩니다.
|
|
</p>
|
|
</section>
|
|
)
|
|
}
|
|
|
|
const selectedQ = SCENARIO_QUADRANTS.find((x) => x.scenario === selected.scenario)
|
|
|
|
return (
|
|
<>
|
|
<section className="rounded-box bg-base-100 p-5">
|
|
<div className="flex items-center justify-between gap-2">
|
|
<h2 className="text-[13px] font-semibold text-base-content/55">협상 케이스</h2>
|
|
<button
|
|
type="button"
|
|
onClick={onChange}
|
|
disabled={busy}
|
|
className="btn btn-ghost btn-xs -mr-1 text-base-content/55"
|
|
>
|
|
처음으로
|
|
</button>
|
|
</div>
|
|
{/* 미니 사분면 — 누르면 해당 케이스로 즉시 새 협상 시작 */}
|
|
<div className="mt-3 grid grid-cols-2 gap-1.5">
|
|
{[['B', 'A'], ['C', 'D']].flat().map((letter) => {
|
|
const q = SCENARIO_QUADRANTS.find((x) => x.letter === letter)
|
|
const c = q && cases.find((x) => x.scenario === q.scenario)
|
|
if (!q || !c) return null
|
|
const active = c.id === selected.id
|
|
return (
|
|
<button
|
|
key={q.scenario}
|
|
type="button"
|
|
disabled={busy}
|
|
onClick={() => !active && onSelect(c)}
|
|
aria-pressed={active}
|
|
aria-label={`시나리오 ${q.letter} — ${q.axis}`}
|
|
className={`cursor-pointer rounded-field py-2 text-center text-base font-extrabold transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none ${
|
|
active
|
|
? `${q.badgeCls} ring-1 ring-current`
|
|
: 'bg-base-200/60 text-base-content/55 hover:bg-base-200'
|
|
}`}
|
|
>
|
|
{q.letter}
|
|
</button>
|
|
)
|
|
})}
|
|
</div>
|
|
<p className="mt-2.5 text-xs text-base-content/50">
|
|
시나리오 <span className={`font-bold ${selectedQ?.textCls ?? ''}`}>{selectedQ?.letter}</span>
|
|
<span className="mx-1">·</span>
|
|
{selectedQ?.axis}
|
|
</p>
|
|
</section>
|
|
|
|
<section className="rounded-box bg-base-100 p-5">
|
|
<h2 className="text-[13px] font-semibold text-base-content/55">상품 정보</h2>
|
|
<p className="mt-2 text-[15px] font-bold">{selected.item_name}</p>
|
|
|
|
{/* 1차 정보: 가격 두 줄만 강조 */}
|
|
<dl className="mt-3 flex flex-col gap-2 text-[13px]">
|
|
<div className="flex items-center justify-between gap-2">
|
|
<dt className="text-base-content/45">기존 공급가</dt>
|
|
<dd className="num text-sm font-semibold">{selected.item_price.toLocaleString()}원</dd>
|
|
</div>
|
|
<div className="flex items-center justify-between gap-2">
|
|
<dt className="text-base-content/45">인터넷 최저가</dt>
|
|
<dd className="num text-sm font-semibold">{selected.card_data.internet_min_price.toLocaleString()}원</dd>
|
|
</div>
|
|
</dl>
|
|
|
|
{/* 2차 정보: 거래 조건은 한 단계 가라앉힌 보조 그리드 */}
|
|
<dl className="mt-3 grid grid-cols-2 gap-x-3 gap-y-2.5 border-t border-base-300/60 pt-3">
|
|
<div>
|
|
<dt className="text-[11px] text-base-content/40">공급 유형</dt>
|
|
<dd className="mt-0.5 text-[13px] font-medium text-base-content/75">{DIST_LABEL[selected.dist]}</dd>
|
|
</div>
|
|
<div>
|
|
<dt className="text-[11px] text-base-content/40">협력사 유형</dt>
|
|
<dd className="mt-0.5 text-[13px] font-medium text-base-content/75">{PARTNER_LABEL[selected.partners_yn]}</dd>
|
|
</div>
|
|
<div>
|
|
<dt className="text-[11px] text-base-content/40">거래 기간</dt>
|
|
<dd className="num mt-0.5 text-[13px] font-medium text-base-content/75">{selected.card_data.trading_period}년</dd>
|
|
</div>
|
|
<div>
|
|
<dt className="text-[11px] text-base-content/40">응답률 / VOC</dt>
|
|
<dd className="num mt-0.5 text-[13px] font-medium text-base-content/75">
|
|
{selected.card_data.response_rate}% / {selected.card_data.voc_count}건
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</section>
|
|
</>
|
|
)
|
|
}
|