diff --git a/app/gyeol/components/Q1Step.tsx b/app/gyeol/components/Q1Step.tsx new file mode 100644 index 0000000..f674035 --- /dev/null +++ b/app/gyeol/components/Q1Step.tsx @@ -0,0 +1,62 @@ +'use client'; + +import { useState } from 'react'; +import { AGE_RANGES, STATUSES } 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 Q1Step({ initial, onPrev, onNext }: Props) { + const [age, setAge] = useState(initial.age_range ?? ''); + const [status, setStatus] = useState(initial.status ?? ''); + + const valid = age && status; + + return ( + onNext({ age_range: age, status })} + nextDisabled={!valid} + > +
+
+ + +
+ +
+ + +
+
+
+ ); +} diff --git a/app/gyeol/components/Q2Step.tsx b/app/gyeol/components/Q2Step.tsx new file mode 100644 index 0000000..eb12012 --- /dev/null +++ b/app/gyeol/components/Q2Step.tsx @@ -0,0 +1,55 @@ +'use client'; + +import { useState } from 'react'; +import { AWARENESS_FREQS } 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 Q2Step({ initial, onPrev, onNext }: Props) { + const [value, setValue] = useState(initial.awareness_freq ?? ''); + + return ( + onNext({ awareness_freq: value })} + nextDisabled={!value} + > +
+ {AWARENESS_FREQS.map((option) => ( + + ))} +
+
+ ); +}