/* eslint-disable jsx-a11y/alt-text */ import React from "react"; import { Document, Page, View, Text, Image } from "@react-pdf/renderer"; import { ModuleScore } from "@/interfaces/module.scores"; import { styles } from "./styles"; import TestReportFooter from "./test.report.footer"; import { StyleSheet } from "@react-pdf/renderer"; const customStyles = StyleSheet.create({ testDetails: { display: "flex", gap: 4, }, testDetailsContainer: { display: "flex", gap: 16, }, table: { width: "100%", }, tableRow: { flexDirection: "row", }, tableCol70: { width: "70%", // First column width (50%) borderStyle: "solid", borderWidth: 1, borderColor: "#000", // padding: 5, }, tableCol25: { width: "16.67%", // Remaining four columns each get 1/6 of the total width (50% / 3 = 16.67%) borderStyle: "solid", borderWidth: 1, borderColor: "#000", padding: 5, }, tableCol20: { width: "20%", // Width for each of the 5 sub-columns (50% / 5 = 20%) borderStyle: "solid", borderWidth: 1, borderColor: "#000", padding: 5, }, tableCol10: { width: "10%", // Width for each of the 5 sub-columns (50% / 5 = 20%) borderStyle: "solid", borderWidth: 1, borderColor: "#000", padding: 5, }, tableCellHeader: { fontSize: 12, textAlign: "center", }, tableCellHeaderColor: { backgroundColor: "#d3d3d3", }, tableCell: { fontSize: 10, textAlign: "center", }, }); interface Props { date: string; name: string; email: string; id: string; gender?: string; passportId: string; corporateName: string; downloadDate: string; userId: string; uniqueExercises: { name: string; result: string }[]; timeSpent: string; score: string; } const LevelTestReport = ({ date, name, email, id, gender, passportId, corporateName, downloadDate, userId, uniqueExercises, timeSpent, score, }: Props) => { const defaultTextStyle = [styles.textFont, { fontSize: 8 }]; return ( Corporate Name: {corporateName} Report Download date: {downloadDate} Test Information: {id} Date of Test: {date} Candidates name: {name} Email: {email} National ID: {passportId} Gender: {gender} Candidate ID: {userId} {/* Header Row */} Test sections Time spent Score {uniqueExercises.map((exercise, index) => ( Part {index + 1} ))} {uniqueExercises.map((exercise, index) => ( {exercise.name} ))} {uniqueExercises.map((exercise, index) => ( {exercise.result} ))} {timeSpent} {score} ); }; export default LevelTestReport;