import type { components } from "../../../contracts/studio/generated.ts"; import { createNewItemId } from "../../../domain/studio/local-id.ts"; import { FieldNotice, type FieldIssue } from "./field-issues.tsx"; import { OrderedTextList } from "./ordered-text-list.tsx"; /** 이 화면이 자기 칸 아래에 보여 줄 수 있는 경로. */ export const QUESTION_FIELD_PATHS = [ "/questionStatus", "/facts", "/assumptions", "/unknowns", "/constraints", "/options", "/nextValidation", "/resolution", ] as const; type CatalogEntry = components["schemas"]["CatalogEntry"]; type QuestionInput = components["schemas"]["QuestionInput"]; type QuestionOption = components["schemas"]["QuestionOption"]; function orderedOptions(options: QuestionOption[]): QuestionOption[] { return options.map((option, order) => ({ ...option, order })); } export function QuestionFields({ draft, evidence, issues, onChange }: { draft: QuestionInput; evidence: CatalogEntry[]; issues: readonly FieldIssue[]; onChange(draft: QuestionInput): void }) { const update = (patch: Partial) => onChange({ ...draft, ...patch }); const moveOption = (index: number, delta: -1 | 1) => { const target = index + delta; if (target < 0 || target >= draft.options.length) return; const next = [...draft.options]; [next[index], next[target]] = [next[target]!, next[index]!]; update({ options: orderedOptions(next) }); }; return (

QUESTION

판단과 다음 검증

update({ facts })} /> update({ assumptions })} /> update({ unknowns })} /> update({ constraints })} />
선택지 {draft.options.length === 0 ?

아직 입력한 선택지가 없습니다.

: null} {draft.options.map((option, index) =>