From d71c6a7f1d3311108dfb82da4ef0998c348619df Mon Sep 17 00:00:00 2001 From: amjed-ali-k Date: Sat, 28 Oct 2023 11:55:44 +0530 Subject: [PATCH] fix pdf --- .../exam/new/_components/PDFgen.tsx | 129 +++++++++--------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx b/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx index e068de7..864b294 100644 --- a/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx +++ b/src/app/dashboard/tools/exam-seating/exam/new/_components/PDFgen.tsx @@ -326,71 +326,74 @@ export function ExamHallPDF({ orientation={(options?.alignment as any) || "portrait"} style={commonStyle.page} > - {options?.title && options.title !== "" && ( - - {options?.title} + + {options?.title && options.title !== "" && ( + + {options?.title} + + )} + + {hall.hallName} - )} - - {hall.hallName} - - - Seating arrangement - - - FRONT SIDE - - - {hall.hallStructure.map((row, ri) => ( - - {row.map((desks, i) => { - const isBlank = desks.structure.every( - (x) => x === SeatType.BLANK - ); - return ( - - {desks.structure.map((seat, di) => { - const col = - row.slice(0, i).reduce((a, b) => a + b.seatCount, 0) + - di; + + Seating arrangement + + + FRONT SIDE + + + {hall.hallStructure.map((row, ri) => ( + + {row.map((desks, i) => { + const isBlank = desks.structure.every( + (x) => x === SeatType.BLANK + ); + return ( + + {desks.structure.map((seat, di) => { + const col = + row + .slice(0, i) + .reduce((a, b) => a + b.seatCount, 0) + di; - return ( - - { - return getSeatData( - ri, - col, - hall.seats, - options?.nameSelect - ); + return ( + - - ); - })} - - ); - })} - - ))} - - - Sign and designation of Invigilator + key={di} + > + { + return getSeatData( + ri, + col, + hall.seats, + options?.nameSelect + ); + }} + /> + + ); + })} + + ); + })} + + ))} + + + Sign and designation of Invigilator + ))} @@ -405,8 +408,6 @@ function getSeatData( type?: string ) { const seat = allocated.find((e) => e.row === row && e.seat === col); - console.log("Option", type); - console.log(seat); if (type && seat && seat[type as keyof typeof seat]) { return seat[type as keyof typeof seat]; }