@@ -5,6 +5,7 @@ import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
55import { Progress } from "@/components/ui/progress" ;
66import { Check , X } from "lucide-react" ;
77import { EXTERNAL } from '@/constant' ;
8+ import LoginMask from './LoginMask' ;
89
910type Report = {
1011 id : string ;
@@ -65,7 +66,7 @@ export default function ReportCard() {
6566 const fileInfoRes = await fetch ( `${ EXTERNAL . directus_url } /files/${ fileId } ` , {
6667 headers : { Authorization : `Bearer ${ EXTERNAL . directus_key } ` } ,
6768 } ) ;
68-
69+
6970 let filename = 'cv.pdf' ;
7071 if ( fileInfoRes . ok ) {
7172 const fileInfo = await fileInfoRes . json ( ) ;
@@ -76,21 +77,21 @@ export default function ReportCard() {
7677 const fileRes = await fetch ( `${ EXTERNAL . directus_url } /assets/${ fileId } ` , {
7778 headers : { Authorization : `Bearer ${ EXTERNAL . directus_key } ` } ,
7879 } ) ;
79-
80+
8081 if ( ! fileRes . ok ) {
8182 throw new Error ( 'Failed to download CV' ) ;
8283 }
8384
8485 // Create blob and download
8586 const blob = await fileRes . blob ( ) ;
8687 const url = window . URL . createObjectURL ( blob ) ;
87-
88+
8889 const link = document . createElement ( 'a' ) ;
8990 link . href = url ;
9091 link . download = filename ;
9192 document . body . appendChild ( link ) ;
9293 link . click ( ) ;
93-
94+
9495 // Cleanup
9596 document . body . removeChild ( link ) ;
9697 window . URL . revokeObjectURL ( url ) ;
@@ -302,6 +303,8 @@ export default function ReportCard() {
302303 { /* Concern Tags */ }
303304 < div >
304305 < h2 className = "text-lg font-semibold mb-2" > Concern Tags</ h2 >
306+ < LoginMask >
307+
305308 < div className = "flex flex-wrap gap-2" >
306309 { report . concern_tags ?. length ? (
307310 report . concern_tags . map ( ( tag , i ) => (
@@ -316,86 +319,96 @@ export default function ReportCard() {
316319 < span className = "text-gray-500 text-sm" > None.</ span >
317320 ) }
318321 </ div >
322+ </ LoginMask >
323+
319324 </ div >
320325
321326 { /* Pros */ }
322327 < div >
323328 < h2 className = "text-lg font-semibold mb-2" > Pros</ h2 >
324- < ul className = "space-y-1" >
325- { prosList . length ? (
326- prosList . map ( ( p , i ) => (
327- < li
328- key = { i }
329- className = "flex items-start gap-2 text-gray-800 break-words"
330- >
331- < Check className = "h-4 w-4 text-green-600 mt-0.5" />
332- { p }
333- </ li >
334- ) )
335- ) : (
336- < li className = "text-gray-500" > No pros listed.</ li >
337- ) }
338- </ ul >
329+ < LoginMask >
330+ < ul className = "space-y-1" >
331+ { prosList . length ? (
332+ prosList . map ( ( p , i ) => (
333+ < li
334+ key = { i }
335+ className = "flex items-start gap-2 text-gray-800 break-words"
336+ >
337+ < Check className = "h-4 w-4 text-green-600 mt-0.5" />
338+ { p }
339+ </ li >
340+ ) )
341+ ) : (
342+ < li className = "text-gray-500" > No pros listed.</ li >
343+ ) }
344+ </ ul >
345+ </ LoginMask >
339346 </ div >
340347
341348 { /* Cons */ }
342349 < div >
343350 < h2 className = "text-lg font-semibold mb-2" > Cons</ h2 >
344- < ul className = "space-y-1" >
345- { consList . length ? (
346- consList . map ( ( c , i ) => (
347- < li
348- key = { i }
349- className = "flex items-start gap-2 text-gray-800 break-words"
350- >
351- < X className = "h-4 w-4 text-red-600 mt-0.5" />
352- { c }
353- </ li >
354- ) )
355- ) : (
356- < li className = "text-gray-500" > No advice listed.</ li >
357- ) }
358- </ ul >
351+ < LoginMask >
352+ < ul className = "space-y-1" >
353+ { consList . length ? (
354+ consList . map ( ( c , i ) => (
355+ < li
356+ key = { i }
357+ className = "flex items-start gap-2 text-gray-800 break-words"
358+ >
359+ < X className = "h-4 w-4 text-red-600 mt-0.5" />
360+ { c }
361+ </ li >
362+ ) )
363+ ) : (
364+ < li className = "text-gray-500" > No advice listed.</ li >
365+ ) }
366+ </ ul >
367+ </ LoginMask >
359368 </ div >
360369
361370 { /* Hiring Advices */ }
362371 < div >
363372 < h2 className = "text-lg font-semibold mb-2" > Hiring Advices</ h2 >
364- < ul className = "space-y-1" >
365- { hiring_advices . length ? (
366- hiring_advices . map ( ( c , i ) => (
367- < li
368- key = { i }
369- className = "flex items-start gap-2 text-gray-800 break-words"
370- >
371- - { c }
372- </ li >
373- ) )
374- ) : (
375- < li className = "text-gray-500" > No advice listed.</ li >
376- ) }
377- </ ul >
373+ < LoginMask >
374+ < ul className = "space-y-1" >
375+ { hiring_advices . length ? (
376+ hiring_advices . map ( ( c , i ) => (
377+ < li
378+ key = { i }
379+ className = "flex items-start gap-2 text-gray-800 break-words"
380+ >
381+ - { c }
382+ </ li >
383+ ) )
384+ ) : (
385+ < li className = "text-gray-500" > No advice listed.</ li >
386+ ) }
387+ </ ul >
388+ </ LoginMask >
378389 </ div >
379390
380391 { /* Candidate Advices */ }
381392 < div >
382393 < h2 className = "text-lg font-semibold mb-2" > Candidate Advices</ h2 >
383- < ul className = "space-y-1" >
384- { candidate_advices . length ? (
385- candidate_advices . map ( ( c , i ) => (
386- < li
387- key = { i }
388- className = "flex items-start gap-2 text-gray-800 break-words"
389- >
390- - { c }
391- </ li >
392- ) )
393- ) : (
394- < li className = "text-gray-500" > No advice listed.</ li >
395- ) }
396- </ ul >
394+ < LoginMask >
395+ < ul className = "space-y-1" >
396+ { candidate_advices . length ? (
397+ candidate_advices . map ( ( c , i ) => (
398+ < li
399+ key = { i }
400+ className = "flex items-start gap-2 text-gray-800 break-words"
401+ >
402+ - { c }
403+ </ li >
404+ ) )
405+ ) : (
406+ < li className = "text-gray-500" > No advice listed.</ li >
407+ ) }
408+ </ ul >
409+ </ LoginMask >
397410 </ div >
398411 </ CardContent >
399- </ Card >
412+ </ Card >
400413 ) ;
401414}
0 commit comments