@@ -3,11 +3,19 @@ import { ArrowLeft } from "lucide-react";
33import { Button } from "@/components/ui/button" ;
44import { Input } from "@/components/ui/input" ;
55import { Label } from "@/components/ui/label" ;
6+ import {
7+ Select ,
8+ SelectContent ,
9+ SelectItem ,
10+ SelectTrigger ,
11+ SelectValue ,
12+ } from "@/components/ui/select" ;
13+ import { GRADE_OPTIONS } from "@/lib/grade" ;
614
715interface ProfileStepProps {
816 defaultName : string ;
917 onBack : ( ) => void ;
10- onComplete : ( name : string , department : string , studentId : string , phone : string ) => void ;
18+ onComplete : ( name : string , department : string , studentId : string , phone : string , grade : string ) => void ;
1119}
1220
1321function formatPhone ( value : string ) : string {
@@ -21,6 +29,7 @@ export function ProfileStep({ defaultName, onBack, onComplete }: ProfileStepProp
2129 const [ department , setDepartment ] = useState ( "" ) ;
2230 const [ studentId , setStudentId ] = useState ( "" ) ;
2331 const [ phone , setPhone ] = useState ( "" ) ;
32+ const [ grade , setGrade ] = useState ( "" ) ;
2433
2534 return (
2635 < div className = "space-y-4" >
@@ -64,10 +73,23 @@ export function ProfileStep({ defaultName, onBack, onComplete }: ProfileStepProp
6473 onChange = { ( e ) => setPhone ( formatPhone ( e . target . value ) ) }
6574 />
6675 </ div >
76+ < div className = "space-y-2" >
77+ < Label > 학년</ Label >
78+ < Select value = { grade } onValueChange = { ( v ) => setGrade ( v ?? "" ) } >
79+ < SelectTrigger >
80+ < SelectValue placeholder = "학년 선택" />
81+ </ SelectTrigger >
82+ < SelectContent >
83+ { GRADE_OPTIONS . map ( ( opt ) => (
84+ < SelectItem key = { opt . value } value = { opt . value } > { opt . label } </ SelectItem >
85+ ) ) }
86+ </ SelectContent >
87+ </ Select >
88+ </ div >
6789 < Button
6890 className = "w-full"
69- onClick = { ( ) => onComplete ( name , department , studentId , phone ) }
70- disabled = { ! name . trim ( ) || ! department . trim ( ) || ! studentId . trim ( ) || phone . replace ( / \D / g, "" ) . length < 7 }
91+ onClick = { ( ) => onComplete ( name , department , studentId , phone , grade ) }
92+ disabled = { ! name . trim ( ) || ! department . trim ( ) || ! studentId . trim ( ) || phone . replace ( / \D / g, "" ) . length < 7 || ! grade }
7193 >
7294 다음
7395 </ Button >
0 commit comments