11"use client" ;
22
33import { useState } from "react" ;
4- import { X , Pencil } from "lucide-react" ;
4+ import { X , Pencil , ArrowLeft , Plus } from "lucide-react" ;
55
66interface Question {
77 title : string ;
@@ -14,6 +14,7 @@ interface CreateExamModelProps {
1414}
1515
1616function CreateExamModel ( { onClose } : CreateExamModelProps ) {
17+ const [ hovered , setHovered ] = useState ( false ) ;
1718 const [ items , setItems ] = useState < string [ ] > ( [ ] ) ;
1819 const [ files , setFiles ] = useState < File [ ] > ( [ ] ) ;
1920 const [ certification , setCertification ] = useState < string > ( "Yes" ) ;
@@ -90,17 +91,34 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
9091
9192 return (
9293 < div className = "w-full h-auto flex bg-inherit absolute left-0 transition-all duration-300 flex-col p-5" >
93- < div className = "flex flex-col gap-10" >
94- < div className = "sticky flex justify-end top-5 right-5" >
95- < button className = " border w-fit rounded-full p-0.5" onClick = { onClose } > < X size = { 14 } color = "white" /> </ button >
96- </ div >
94+ < div className = "absolute flex justify-start -top-4 left-5 " >
95+ < button onClick = { onClose } >
96+ < ArrowLeft className = "text-4xl" color = "white" />
97+ </ button >
98+ </ div >
99+ < div className = "flex flex-col gap-10 overflow-y-auto scrollbar-hide scroll-smooth" >
97100 < form className = "flex flex-col gap-10" onSubmit = { handleSubmit } >
98101 < div className = "md:flex w-full space-y-5 md:space-y-0 gap-4" >
99102 < div className = "flex flex-col w-full md:w-[60%] gap-[20px]" >
103+ < div
104+ className = "w-full h-52 border border-dashed border-gray-600 rounded-lg flex flex-col items-center justify-center bg-[#121212] hover:border-gray-400 transition-colors"
105+ onMouseEnter = { ( ) => setHovered ( true ) }
106+ onMouseLeave = { ( ) => setHovered ( false ) }
107+ >
108+ < p className = "text-gray-300 mb-3" > Upload Image</ p >
109+ < div
110+ className = { `w-12 h-12 rounded-full flex items-center justify-center bg-[#2a2a2a] ${
111+ hovered ? "bg-gray-500" : ""
112+ } transition-colors`}
113+ >
114+ < Plus className = "text-gray-200" />
115+ </ div >
116+ </ div >
100117 < div className = "flex flex-col w-full" >
101118 < label
102119 className = "text-[#9596A0] text-[0.875rem] mb-1"
103- htmlFor = "examName" >
120+ htmlFor = "examName"
121+ >
104122 Exam Name*
105123 </ label >
106124 < input
@@ -116,28 +134,30 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
116134 < div className = "w-full flex flex-col" >
117135 < label
118136 className = "text-[#9596A0] text-[0.875rem] mb-1"
119- htmlFor = "examDescription" >
137+ htmlFor = "examDescription"
138+ >
120139 Exam Description
121140 </ label >
122141 < textarea
123142 id = "examDescription"
124143 className = "bg-transparent placeholder:text-[#5E5E5E] border-[1px] min-h-[176px] outline-none border-[#252625] text-white text-[0.875rem] w-full md:w-full px-4 py-[0.40rem] rounded-[0.5rem]"
125144 placeholder = "Write exam description"
126145 value = { examDescription }
127- onChange = { ( e ) =>
128- setExamDescription ( e . target . value )
129- } > </ textarea >
146+ onChange = { ( e ) => setExamDescription ( e . target . value ) }
147+ > </ textarea >
130148 </ div >
131149 < div className = "flex w-full flex-col items-stretch" >
132150 < label
133151 className = "text-[#9596A0] text-[0.875rem] mb-1"
134- htmlFor = "examType" >
152+ htmlFor = "examType"
153+ >
135154 Exam Type*
136155 </ label >
137156 < select
138157 className = "bg-transparent border-[1px] outline-none border-[#252625] text-white text-[0.875rem] w-full px-4 py-[0.40rem] rounded-[0.5rem]"
139158 value = { examType }
140- onChange = { ( e ) => setExamType ( e . target . value ) } >
159+ onChange = { ( e ) => setExamType ( e . target . value ) }
160+ >
141161 < option className = "bg-[#161716]" value = "MC" >
142162 Multiple choice
143163 </ option >
@@ -148,16 +168,40 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
148168 </ div >
149169 </ div >
150170 < div className = "flex flex-col w-full gap-[24px] md:w-[40%]" >
171+ < button className = "text-[#0E0F0E] bg-[#D0EFB1] py-3 text-center rounded-lg" >
172+ Publish For $50
173+ </ button >
174+ < button className = "text-[#D6DFFE] bg-[#2D2E2D] py-3 text-center rounded-lg" >
175+ Add to draft
176+ </ button >
177+ < div className = "flex w-full flex-col items-stretch" >
178+ < label
179+ className = "text-[#9596A0] text-[0.875rem] mb-1"
180+ htmlFor = "courseAmount"
181+ >
182+ Exam amount*
183+ </ label >
184+ < select className = "bg-transparent border-[1px] outline-none border-[#252625] text-white text-[0.875rem] w-full px-3 py-2 rounded-[0.5rem]" >
185+ < option className = "bg-[#161716]" value = "24" >
186+ $24
187+ </ option >
188+ < option className = "bg-[#161716]" value = "45" >
189+ $45
190+ </ option >
191+ </ select >
192+ </ div >
151193 < div className = "flex w-full flex-col items-stretch" >
152194 < label
153195 className = "text-[#9596A0] text-[0.875rem] mb-1"
154- htmlFor = "candidateEligibility" >
196+ htmlFor = "candidateEligibility"
197+ >
155198 Candidate Eligibility*
156199 </ label >
157200 < select
158201 className = "bg-transparent border-[1px] outline-none border-[#252625] text-white text-[0.875rem] w-full px-4 py-[0.40rem] rounded-[0.5rem]"
159202 value = { candidateEligibility }
160- onChange = { ( e ) => setCandidateEligibility ( e . target . value ) } >
203+ onChange = { ( e ) => setCandidateEligibility ( e . target . value ) }
204+ >
161205 < option className = "bg-[#161716]" value = "SC" >
162206 Paid Exam
163207 </ option >
@@ -169,7 +213,8 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
169213 < div >
170214 < label
171215 className = "text-[#9596A0] text-[0.875rem] mb-1"
172- htmlFor = "courseCategory" >
216+ htmlFor = "courseCategory"
217+ >
173218 Exam Category
174219 </ label >
175220 < div className = "bg-transparent border-[1px] outline-none border-[#252625] text-white text-[0.875rem] w-full px-4 py-[0.30rem] rounded-[0.5rem]" >
@@ -179,19 +224,22 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
179224 scrollbarWidth : "none" ,
180225 msOverflowStyle : "none" ,
181226 } }
182- className = "overflow-x-scroll flex gap-[8px]" >
227+ className = "overflow-x-scroll flex gap-[8px]"
228+ >
183229 { items . map ( ( item , index ) => (
184230 < div
185231 key = { index }
186- className = "bg-transparent text-white gap-2 flex items-center flex-none px-2 border-[#252625] border rounded-[8px]" >
232+ className = "bg-transparent text-white gap-2 flex items-center flex-none px-2 border-[#252625] border rounded-[8px]"
233+ >
187234 { item }
188235 < X size = { 14 } color = "white" />
189236 </ div >
190237 ) ) }
191238 </ div >
192239 < button
193240 onClick = { handleAddItem }
194- className = "bg-transparent text-white px-2 border-[#252625] border rounded-[8px]" >
241+ className = "bg-transparent text-white px-2 border-[#252625] border rounded-[8px]"
242+ >
195243 Add
196244 </ button >
197245 </ div >
@@ -200,13 +248,15 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
200248 < div className = "flex w-full flex-col gap-[5px] items-stretch" >
201249 < label
202250 className = "text-[#9596A0] text-[0.875rem] mb-1"
203- htmlFor = "certification" >
251+ htmlFor = "certification"
252+ >
204253 Certification*
205254 </ label >
206255 < select
207256 className = "bg-transparent border-[1px] outline-none border-[#252625] text-white text-[0.875rem] w-full px-4 py-[0.40rem] rounded-[0.5rem]"
208257 value = { certification }
209- onChange = { handleCertificationChange } >
258+ onChange = { handleCertificationChange }
259+ >
210260 < option className = "bg-[#161716]" value = "Yes" >
211261 Yes
212262 </ option >
@@ -222,11 +272,13 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
222272 scrollbarWidth : "none" ,
223273 msOverflowStyle : "none" ,
224274 } }
225- className = "overflow-x-scroll flex gap-[8px]" >
275+ className = "overflow-x-scroll flex gap-[8px]"
276+ >
226277 { files . map ( ( file , index ) => (
227278 < div
228279 key = { index }
229- className = "bg-transparent text-white px-2 flex flex-none border-[#252625] border rounded-[8px] items-center gap-2" >
280+ className = "bg-transparent text-white px-2 flex flex-none border-[#252625] border rounded-[8px] items-center gap-2"
281+ >
230282 { file . name }
231283 < button onClick = { ( ) => handleRemoveFile ( index ) } >
232284 < X size = { 14 } color = "white" />
@@ -243,7 +295,8 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
243295 />
244296 < label
245297 htmlFor = "fileInput"
246- className = "bg-transparent text-white px-2 border-[#252625] border rounded-[8px] flex items-center gap-1 cursor-pointer" >
298+ className = "bg-transparent text-white px-2 border-[#252625] border rounded-[8px] flex items-center gap-1 cursor-pointer"
299+ >
247300 Add file < X size = { 16 } color = "white" />
248301 </ label >
249302 </ div >
@@ -253,7 +306,8 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
253306 < div className = "flex flex-col w-full items-stretch" >
254307 < label
255308 className = "text-[#9596A0] text-[0.875rem] mb-1"
256- htmlFor = "duration" >
309+ htmlFor = "duration"
310+ >
257311 Exam Duration*
258312 </ label >
259313 < input
@@ -280,7 +334,8 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
280334 { questions . map ( ( question , index ) => (
281335 < div
282336 key = { index }
283- className = "flex items-center md:w-[70%] gap-5 justify-between mb-3" >
337+ className = "flex items-center md:w-[70%] gap-5 justify-between mb-3"
338+ >
284339 < span className = "bg-transparent border-[1px] outline-none border-[#252625] text-white text-[0.875rem] w-full px-4 py-[0.40rem] rounded-[0.5rem]" >
285340 { question . title }
286341 </ span >
@@ -329,7 +384,8 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
329384 < div className = "flex flex-col mt-3" >
330385 < label
331386 className = "text-[#9596A0] text-[0.875rem] mb-1"
332- htmlFor = "answer" >
387+ htmlFor = "answer"
388+ >
333389 Answer
334390 </ label >
335391 < input
@@ -345,7 +401,8 @@ function CreateExamModel({ onClose }: CreateExamModelProps) {
345401 < div className = "flex items-center justify-center w-full " >
346402 < button
347403 onClick = { handleAddQuestion }
348- className = "font-[WorkSans] py-[12px] px-[24px] font-medium bg-[#2D2E2D] rounded-[8px]" >
404+ className = "font-[WorkSans] py-[12px] px-[24px] font-medium bg-[#2D2E2D] rounded-[8px]"
405+ >
349406 < span className = "font-black text-white" > +</ span > ADD QUESTION
350407 </ button >
351408 </ div >
0 commit comments