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) => ( + + ))} +
+
+
+
+ ); +}