@@ -13,6 +13,7 @@ import {
1313import { toast } from "react-toastify" ;
1414import DetailItem from "../components/TraineeDetail/DetailItem" ;
1515import ProgramItem from "../components/TraineeDetail/ProgramBox" ;
16+ import { DownloadPdf } from "../utils/DownloadPdf" ;
1617
1718const TrainneeDetails = ( props : any ) => {
1819 const params = useParams ( ) ;
@@ -54,153 +55,169 @@ const TrainneeDetails = (props: any) => {
5455
5556 const traineeDetails = oneTraineeDetails . data ;
5657
57- const updateManyScoreValues = ( ) => {
58- const scores = scoreValue . map ( ( values : any ) => {
59- delete values . test ;
60- return values ;
61- } ) ;
62- props . updateManyScoreValues ( scores ) ;
63- } ;
58+
59+
6460
6561 return (
6662 < >
67- < Navbar />
68- < div className = "flex items-center overflow-auto dark:bg-dark-frame-bg" >
69- < div className = "block w-[100%] pl-[16rem] h-max md:pl-0 mx-auto dark:bg-dark-frame-bg pb-10 mt-10 pt-[80px]" >
70- { traineeDetails && (
71- < div className = "w-full mx-16 bg-slate-200 rounded-xl shadow-md overflow-hidden md:max-w-2xl mb-6 lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white" >
72- < div className = "md:flex" >
73- < h2 className = "top-5 m-5 font-medium md:m-3" >
74- < span className = "pl-5 text-lg text-[#56C870] uppercase" >
75- Trainee Applicant Information
76- </ span >
77- </ h2 >
78- < div className = "m-5 sm:mt-20 sm:ml-[-12rem] md:shrink-0 lg:ml-10 lg:mt-10" >
63+ < div className = "w-full flex items-center bg-white overflow-auto dark:bg-dark-frame-bg" >
64+ < div className = "block w-[100%] pl-20 h-max md:pl-0 mx-auto dark:bg-dark-frame-bg pb-10 pt-[80px]" >
65+ < div className = "" id = "trainee-info" >
66+ { traineeDetails && (
67+ < div className = "w-full bg-slate-200 mx-16 rounded-xl shadow-md overflow-hidden md:max-w-2xl mb-6 lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white" >
68+ < div className = " md:flex " >
69+ < h2 className = "top-5 m-5 font-medium md:m-3" >
70+ < span className = "pl-5 text-lg text-[#56C870] uppercase" >
71+ Trainee Applicant Information
72+ </ span >
73+ </ h2 >
74+ < div className = "m-5 sm:mt-20 sm:ml-[-12rem] md:shrink-0 lg:ml-10 lg:mt-10" >
75+ < DetailItem
76+ title = "FirstName"
77+ value = { traineeDetails ?. trainee_id ?. firstName }
78+ />
79+ < DetailItem title = "Gender" value = { traineeDetails . gender } />
80+ < DetailItem
81+ title = "Address"
82+ value = { traineeDetails . Address }
83+ />
84+ < DetailItem
85+ title = "Phone Number"
86+ value = { traineeDetails . phone }
87+ />
88+ < DetailItem
89+ title = "Field of Study"
90+ value = { traineeDetails . field_of_study }
91+ />
92+ < DetailItem
93+ title = "Education Level"
94+ value = { traineeDetails . education_level }
95+ />
96+ < DetailItem
97+ title = "Is Student"
98+ value = { traineeDetails . isStudent }
99+ />
100+ < DetailItem
101+ title = "Is Employed"
102+ value = { traineeDetails . isEmployed }
103+ />
104+ < DetailItem
105+ title = "Email"
106+ value = { traineeDetails ?. trainee_id ?. email }
107+ />
108+ </ div >
109+ </ div >
110+ < div className = "m-5 sm:ml-[20rem] md:ml-2 lg:mt-20 lg:ml-[5rem]" >
79111 < DetailItem
80- title = "FirstName "
81- value = { traineeDetails ?. trainee_id ?. firstName }
112+ title = "LastName "
113+ value = { traineeDetails ?. trainee_id ?. lastName }
82114 />
83- < DetailItem title = "Gender" value = { traineeDetails . gender } />
84- < DetailItem title = "Address" value = { traineeDetails . Address } />
85115 < DetailItem
86- title = "Phone Number "
87- value = { traineeDetails . phone }
116+ title = "Province "
117+ value = { traineeDetails . province }
88118 />
89119 < DetailItem
90- title = "Field of Study "
91- value = { traineeDetails . field_of_study }
120+ title = "District "
121+ value = { traineeDetails . district }
92122 />
123+ < DetailItem title = "Sector" value = { traineeDetails . sector } />
93124 < DetailItem
94- title = "Education Level "
95- value = { traineeDetails . education_level }
125+ title = "Interview decision "
126+ value = { traineeDetails . interview_decision }
96127 />
97128 < DetailItem
98- title = "Is Student "
99- value = { traineeDetails . isStudent }
129+ title = "Hackerrank Score "
130+ value = { traineeDetails . Hackerrank_score }
100131 />
101132 < DetailItem
102- title = "Is Employed "
103- value = { traineeDetails . isEmployed }
133+ title = "English Score "
134+ value = { traineeDetails . english_score }
104135 />
105136 < DetailItem
106- title = "Email"
107- value = { traineeDetails ?. trainee_id ?. email }
137+ title = "Date of Birth"
138+ value = { new Intl . DateTimeFormat ( "en-CA" , {
139+ year : "numeric" ,
140+ month : "2-digit" ,
141+ day : "2-digit" ,
142+ } ) . format ( traineeDetails . birth_date ) }
108143 />
109144 </ div >
110145 </ div >
111- < div className = "m-5 sm:ml-[20rem] md:ml-2 lg:mt-20 lg:ml-[5rem]" >
112- < DetailItem
113- title = "LastName"
114- value = { traineeDetails ?. trainee_id ?. lastName }
115- />
116- < DetailItem title = "Province" value = { traineeDetails . province } />
117- < DetailItem title = "District" value = { traineeDetails . district } />
118- < DetailItem title = "Sector" value = { traineeDetails . sector } />
119- < DetailItem
120- title = "Interview decision"
121- value = { traineeDetails . interview_decision }
122- />
123- < DetailItem
124- title = "Hackerrank Score"
125- value = { traineeDetails . Hackerrank_score }
126- />
127- < DetailItem
128- title = "English Score"
129- value = { traineeDetails . english_score }
130- />
131- < DetailItem
132- title = "Date of Birth"
133- value = { new Intl . DateTimeFormat ( "en-CA" , {
134- year : "numeric" ,
135- month : "2-digit" ,
136- day : "2-digit" ,
137- } ) . format ( traineeDetails . birth_date ) }
138- />
139- </ div >
140- </ div >
141- ) }
142- { traineeDetails && (
143- < div className = "w-full mx-16 bg-slate-200 rounded-xl shadow-md overflow-hidden md:max-w-2xl mb-6 lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white" >
144- < div className = "" >
145- < h2 className = "top-5 m-5 font-medium" >
146- < span className = "pl-3 text-lg text-[#56C870] uppercase" >
147- Application Information
148- </ span >
149- </ h2 >
150- < div className = "flex flex-col gap-7 m-5 lg:my-14" >
151- < ProgramItem
152- title = "Application Cycle"
153- value = { traineeDetails . trainee_id ?. cycle_id ?. name }
154- Icon = { FaRecycle }
155- />
146+ ) }
156147
157- < ProgramItem
158- title = "Program"
159- value = "Andela Technical Leadership Program"
160- Icon = { FaRecycle }
161- />
148+ { traineeDetails && (
149+ < div className = "w-full mx-16 bg-slate-200 rounded-xl shadow-md overflow-hidden md:max-w-2xl mb-6 lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white" >
150+ < div className = "" >
151+ < h2 className = "top-5 m-5 font-medium" >
152+ < span className = "pl-3 text-lg text-[#56C870] uppercase" >
153+ Application Information
154+ </ span >
155+ </ h2 >
156+ < div className = "flex flex-col gap-7 m-5 lg:my-14" >
157+ < ProgramItem
158+ title = "Application Cycle"
159+ value = { traineeDetails . trainee_id ?. cycle_id ?. name }
160+ Icon = { FaRecycle }
161+ />
162+
163+ < ProgramItem
164+ title = "Program"
165+ value = "Andela Technical Leadership Program"
166+ Icon = { FaRecycle }
167+ />
168+ </ div >
162169 </ div >
163- </ div >
164- < div className = "mt-12 " >
165- < div className = "flex flex-col gap-7 m-5 lg:my-14" >
166- < ProgramItem
167- title = "Application start date"
168- value = { traineeDetails . trainee_id ?. cycle_id ?. startDate }
169- Icon = { LuCalendarDays }
170- />
171- < ProgramItem
172- title = "Expected program end Date"
173- value = { traineeDetails . trainee_id ?. cycle_id ?. endDate }
174- Icon = { LuCalendarDays }
175- / >
170+ < div className = "mt-12" >
171+ < div className = "flex flex-col gap-7 m-5 lg:my-14 " >
172+ < ProgramItem
173+ title = "Application start date"
174+ value = { traineeDetails . trainee_id ?. cycle_id ?. startDate }
175+ Icon = { LuCalendarDays }
176+ />
177+ < ProgramItem
178+ title = "Expected program end Date"
179+ value = { traineeDetails . trainee_id ?. cycle_id ?. endDate }
180+ Icon = { LuCalendarDays }
181+ />
182+ </ div >
176183 </ div >
177184 </ div >
178- </ div >
179- ) }
185+ ) }
186+ </ div >
180187
181- < div className = "w-full flex flex-col mx-16 pb-2 bg-slate-200 rounded-xl shadow-md overflow-hidden md:max-w-2xl mb-6 lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white" >
182- < h2 className = "font-bold text-lg text-[#56C870] top-5 pb-7 ml-5 mt-5 uppercase" >
188+ < div className = "w-full py-7 flex flex-col mx-16 bg-slate-200 rounded-xl shadow-md overflow-hidden md:max-w-2xl lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white" >
189+ < h2 className = "font-bold text-lg text-[#56C870] top-5 ml-5 mt-[-10px] pb-2 uppercase" >
183190 Status
184191 </ h2 >
185- { traineeDetails . interview_decision === "Passed" ? (
186- < div className = "py-10 btn ml-5 mt-[-10%] mb-3" >
187- < button className = "btn-Aprov bg-[#56C870] hover:bg-[#67dc82] dark:hover:bg-[#1f544cef] text-white font-bold py-2 px-4 rounded mt-7 mr-4 dark:bg-[#56C870]" >
188- Passed
189- </ button >
192+ < div className = "h-16 flex items-center mt-[-8px] gap-5 " >
193+ < div >
194+ { traineeDetails . interview_decision === "Passed" ? (
195+ < div className = "py-10 btn ml-5 mt-[-10%] mb-3" >
196+ < button className = "btn-Aprov bg-[#56C870] hover:bg-[#67dc82] dark:hover:bg-[#1f544cef] text-white font-bold py-2 px-4 rounded mt-7 mr-4 dark:bg-[#56C870]" >
197+ Passed
198+ </ button >
199+ </ div >
200+ ) : traineeDetails . interview_decision === "Relegated" ? (
201+ < div className = "py-10 btn ml-5 mt-[-10%] mb-3" >
202+ < button className = "btn-Aprov3 bg-yellow-400 hover:text-white hover:bg-yellow-300 text-white font-bold mt-7 py-2 px-2 rounded" >
203+ Relegated
204+ </ button >
205+ </ div >
206+ ) : (
207+ < div className = "py-10 btn ml-5 mt-[-10%] mb-3" >
208+ < button className = "btn-Aprov3 bg-red-800 hover:text-white hover:bg-red-500 text-white font-bold mt-7 py-2 px-2 rounded" >
209+ Failed
210+ </ button >
211+ </ div >
212+ ) }
190213 </ div >
191- ) : traineeDetails . interview_decision === "Relegated" ? (
192- < div className = "py-10 btn ml-5 mt-[-10%] mb-3" >
193- < button className = "btn-Aprov3 bg-yellow-400 hover:text-white hover:bg-yellow-300 text-white font-bold mt-7 py-2 px-2 rounded" >
194- Relegated
195- </ button >
196- </ div >
197- ) : (
198- < div className = "py-10 btn ml-5 mt-[-10%] mb-3" >
199- < button className = "btn-Aprov3 bg-red-800 hover:text-white hover:bg-red-500 text-white font-bold mt-7 py-2 px-2 rounded" >
200- Failed
201- </ button >
202- </ div >
203- ) }
214+ < button
215+ onClick = { ( ) => DownloadPdf ( "trainee-info" ) }
216+ className = "btn-Aprov h-11 bg-blue-700 hover:bg-blue-600 dark:hover:bg-blue-600 text-white font-bold py-2 px-2 rounded dark:bg-blue-700"
217+ >
218+ Download PDF
219+ </ button >
220+ </ div >
204221 </ div >
205222 </ div >
206223 </ div >
0 commit comments