From d622dafcce93e0d6b854a4d567328df55aa56777 Mon Sep 17 00:00:00 2001 From: gahusb Date: Sat, 16 May 2026 05:27:56 +0900 Subject: [PATCH] =?UTF-8?q?feat(gyeol):=20Q4Step=20(=EB=B9=84=EC=9A=A9=20?= =?UTF-8?q?=EB=9D=BC=EB=94=94=EC=98=A4=206)=20+=20Q5Step=20(=EB=8F=84?= =?UTF-8?q?=EA=B5=AC=20=EB=9D=BC=EB=94=94=EC=98=A4=208=20+=20=EB=A7=8C?= =?UTF-8?q?=EC=A1=B1=EB=8F=84=201-5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Q4: 라디오 패턴 재사용 (Q2와 동일 스타일) - Q5: 두 입력 한 화면 — 도구 라디오 + 만족도 1-5 버튼 그리드 - 둘 다 선택 시 다음 활성 Co-Authored-By: Claude Opus 4.7 (1M context) --- app/gyeol/components/Q4Step.tsx | 55 ++++++++++++++++++++++ app/gyeol/components/Q5Step.tsx | 83 +++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 app/gyeol/components/Q4Step.tsx create mode 100644 app/gyeol/components/Q5Step.tsx diff --git a/app/gyeol/components/Q4Step.tsx b/app/gyeol/components/Q4Step.tsx new file mode 100644 index 0000000..4679b51 --- /dev/null +++ b/app/gyeol/components/Q4Step.tsx @@ -0,0 +1,55 @@ +'use client'; + +import { useState } from 'react'; +import { COST_RANGES } from '@/lib/survey/questions'; +import type { SurveyResponse } from '@/lib/survey/types'; +import QuestionLayout from './QuestionLayout'; + +interface Props { + initial: Partial; + onPrev: () => void; + onNext: (partial: Partial) => void; +} + +export default function Q4Step({ initial, onPrev, onNext }: Props) { + const [value, setValue] = useState(initial.cost_range ?? ''); + + return ( + onNext({ cost_range: value })} + nextDisabled={!value} + > +
+ {COST_RANGES.map((option) => ( + + ))} +
+
+ ); +} diff --git a/app/gyeol/components/Q5Step.tsx b/app/gyeol/components/Q5Step.tsx new file mode 100644 index 0000000..23256f5 --- /dev/null +++ b/app/gyeol/components/Q5Step.tsx @@ -0,0 +1,83 @@ +'use client'; + +import { useState } from 'react'; +import { BEST_TOOLS, SATISFY_SCALE } from '@/lib/survey/questions'; +import type { SurveyResponse } from '@/lib/survey/types'; +import QuestionLayout from './QuestionLayout'; + +interface Props { + initial: Partial; + onPrev: () => void; + onNext: (partial: Partial) => void; +} + +export default function Q5Step({ initial, onPrev, onNext }: Props) { + const [tool, setTool] = useState(initial.best_tool ?? ''); + const [satisfy, setSatisfy] = useState(initial.best_satisfy ?? null); + + const valid = tool && satisfy !== null; + + return ( + onNext({ best_tool: tool, best_satisfy: satisfy ?? undefined })} + nextDisabled={!valid} + > +
+
+

가장 도움 됐던 거

+
+ {BEST_TOOLS.map((option) => ( + + ))} +
+
+ +
+

만족도 (5점 만점)

+
+ {SATISFY_SCALE.map((n) => ( + + ))} +
+
+
+
+ ); +}