시작 화면을 시나리오 선택으로 — 채팅 영역 4분면 피커·좌측 패널은 선택 요약으로 역할 변경
- 첫 화면: 채팅 영역에 시나리오 설명 + A/B/D/C 카드(상품명 제거), 선택 시 협상 시작 - 좌측 패널: 선택 UI 중복 제거 — 선택된 시나리오 요약 + '시나리오 변경'(피커 복귀) - 상품 정보: 공급 유형·협력사 유형(X/단독/다수) 두 행으로 분리 - 채팅 하단 옵션 버튼 우측 정렬, 선택 전 우측 가격 패널은 빈 상태 안내 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UFZ7JWdwCaQAwNYJErL8pP
This commit is contained in:
1 parent
2e5fefada7
commit
e781583412
5 files changed
+195
-139
No files matched your search
@@ -1,60 +1,51 @@
|
||||
import { DIST_LABEL, type DemoCase } from '../content/cases'
|
||||
|
||||
// 시나리오 4분면 — 행: 매출 규모(높음/낮음), 열: 경쟁 강도(높음/낮음)
|
||||
const QUADRANTS = [
|
||||
{ scenario: 'Scenario_A', letter: 'A', axis: '매출 높음 · 경쟁 높음' },
|
||||
{ scenario: 'Scenario_B', letter: 'B', axis: '매출 높음 · 경쟁 낮음' },
|
||||
{ scenario: 'Scenario_D', letter: 'D', axis: '매출 낮음 · 경쟁 높음' },
|
||||
{ scenario: 'Scenario_C', letter: 'C', axis: '매출 낮음 · 경쟁 낮음' },
|
||||
]
|
||||
import { DIST_LABEL, PARTNER_LABEL, SCENARIO_QUADRANTS, type DemoCase } from '../content/cases'
|
||||
|
||||
export function CasePanel({
|
||||
cases, selected, started, busy, onStart,
|
||||
selected, busy, onChange,
|
||||
}: {
|
||||
cases: DemoCase[]
|
||||
selected: DemoCase
|
||||
started: boolean
|
||||
selected: DemoCase | null
|
||||
busy: boolean
|
||||
onStart: (c: DemoCase) => void
|
||||
onChange: () => void
|
||||
}) {
|
||||
if (!selected) {
|
||||
return (
|
||||
<aside className="flex flex-col gap-4 min-[960px]:min-h-0 min-[960px]:overflow-y-auto">
|
||||
<section className="rounded-box bg-base-100 p-5">
|
||||
<h2 className="text-xs font-semibold text-base-content/55">협상 케이스</h2>
|
||||
<p className="mt-3 text-xs leading-relaxed text-base-content/50">
|
||||
가운데 화면에서 시나리오를 선택하면 진행 중인 케이스와 상품 정보가
|
||||
여기에 표시됩니다.
|
||||
</p>
|
||||
</section>
|
||||
</aside>
|
||||
)
|
||||
}
|
||||
|
||||
const q = SCENARIO_QUADRANTS.find((x) => x.scenario === selected.scenario)
|
||||
|
||||
return (
|
||||
<aside className="flex flex-col gap-4 min-[960px]:min-h-0 min-[960px]:overflow-y-auto">
|
||||
<section className="rounded-box bg-base-100 p-5">
|
||||
<h2 className="text-xs font-semibold text-base-content/55">협상 케이스</h2>
|
||||
<div className="mt-3 grid grid-cols-2 gap-2">
|
||||
{QUADRANTS.map((q) => {
|
||||
const c = cases.find((x) => x.scenario === q.scenario)
|
||||
if (!c) return null
|
||||
const active = started && c.id === selected.id
|
||||
return (
|
||||
<button
|
||||
key={q.scenario}
|
||||
type="button"
|
||||
disabled={busy}
|
||||
onClick={() => onStart(c)}
|
||||
aria-pressed={active}
|
||||
className={`cursor-pointer rounded-field p-3 text-left transition-colors focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none ${
|
||||
active ? 'bg-primary/8 ring-1 ring-primary/30' : 'bg-base-200/60 hover:bg-base-200'
|
||||
} ${busy ? 'opacity-60' : ''}`}
|
||||
>
|
||||
<div className="flex items-baseline gap-1.5">
|
||||
<span className={`text-lg font-extrabold ${active ? 'text-primary' : ''}`}>{q.letter}</span>
|
||||
<span className="text-[10px] font-medium text-base-content/45">시나리오</span>
|
||||
</div>
|
||||
<p className="mt-0.5 text-[10px] leading-tight text-base-content/50">{q.axis}</p>
|
||||
<p className={`mt-1.5 truncate text-xs font-semibold ${active ? 'text-primary' : 'text-base-content/80'}`}>
|
||||
{c.item_name}
|
||||
</p>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<h2 className="text-xs 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-2 flex items-center gap-2.5">
|
||||
<span className="flex size-9 shrink-0 items-center justify-center rounded-field bg-primary/10 text-lg font-extrabold text-primary">
|
||||
{q?.letter ?? '?'}
|
||||
</span>
|
||||
<div className="min-w-0">
|
||||
<p className="text-sm font-bold">시나리오 {q?.letter}</p>
|
||||
<p className="truncate text-[11px] text-base-content/50">{q?.axis}</p>
|
||||
</div>
|
||||
</div>
|
||||
{!started && (
|
||||
<p className="mt-3 text-xs leading-relaxed text-base-content/50">
|
||||
시나리오를 선택하면 협상이 시작됩니다. 챗봇은 구매 담당자(MD) 역할이고,
|
||||
당신은 공급사로서 가격 제안에 응답합니다.
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
|
||||
<section className="rounded-box bg-base-100 p-5">
|
||||
@@ -71,7 +62,11 @@ export function CasePanel({
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<dt className="text-base-content/50">공급 유형</dt>
|
||||
<dd className="font-medium">{DIST_LABEL[selected.dist]} · 협력사 {selected.partners_yn}</dd>
|
||||
<dd className="font-medium">{DIST_LABEL[selected.dist]}</dd>
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<dt className="text-base-content/50">협력사 유형</dt>
|
||||
<dd className="font-medium">{PARTNER_LABEL[selected.partners_yn]}</dd>
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<dt className="text-base-content/50">거래 기간</dt>
|
||||
|
||||
Reference in new issue
Block a user