/* eslint-disable jsx-a11y/alt-text */ import React from "react"; import { Document, Page, View, Text, Image, StyleSheet, Font, } from "@react-pdf/renderer"; import { styles } from "./styles"; import TestReportFooter from "./test.report.footer"; import { StudentData } from "@/interfaces/module.scores"; import ProgressBar from "./progress.bar"; Font.registerHyphenationCallback((word) => [word]); interface Props { date: string; name: string; email: string; id: string; gender?: string; summary: string; logo: string; qrcode: string; renderDetails: React.ReactNode; title: string; numberOfStudents: number; institution: string; studentsData: StudentData[]; showLevel: boolean; summaryPNG: string; summaryScore: string; groupScoreSummary: any[]; passportId: string; } const customStyles = StyleSheet.create({ tableCellHighlight: { backgroundColor: "#4f4969", color: "#bc9970", }, table: { display: "flex", flexDirection: "column", // maxWidth: "600px", // margin: "0 auto", // borderCollapse: 'collapse', }, tableRow: { display: "flex", flexDirection: "row", }, tableHeader: { fontWeight: "bold", backgroundColor: "#f2f2f2", }, tableCell: { flex: 1, padding: "8px", textAlign: "left", wordBreak: "break-all", }, }); const GroupTestReport = ({ title, date, name, email, id, gender, summary, logo, qrcode, renderDetails, numberOfStudents, institution, studentsData, showLevel, summaryPNG, summaryScore, groupScoreSummary, passportId, }: Props) => { const defaultTextStyle = [styles.textFont, { fontSize: 8 }]; return ( {title} Date of Test: {date} Candidate Information: Total Number of Students: {numberOfStudents} Institution: {institution} Group Test Details: {renderDetails} Group Overall Performance Summary {summary} {summaryScore} Group Score Summary {groupScoreSummary.map(({ label, percent, description }) => ( {label} {percent}% {description} ))} Sr Candidate Name Passport ID Email ID Date of test Result {showLevel && Level} {studentsData.map( ( { id, name, email, gender, date, result, level, passportId: studentPassportId, }, index ) => ( {index + 1} {name} {studentPassportId} {email} {date} {result} {showLevel && ( {level} )} ) )} ); }; export default GroupTestReport;