Added level to table

This commit is contained in:
Joao Ramos
2024-01-09 18:47:32 +00:00
parent f8bf58e57c
commit 4e378f0c71
3 changed files with 67 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ import {
} from "@react-pdf/renderer";
import { styles } from "./styles";
import TestReportFooter from "./test.report.footer";
import { ModuleScore } from "@/interfaces/module.scores";
import { ModuleScore, StudentData } from "@/interfaces/module.scores";
import ProgressBar from "./progress.bar";
Font.registerHyphenationCallback((word) => [word]);
@@ -30,7 +30,8 @@ interface Props {
title: string;
numberOfStudents: number;
institution: string;
studentsData: any[];
studentsData: StudentData[];
showLevel: boolean;
}
const customStyles = StyleSheet.create({
@@ -78,6 +79,7 @@ const GroupTestReport = ({
numberOfStudents,
institution,
studentsData,
showLevel,
}: Props) => {
const defaultTextStyle = [styles.textFont, { fontSize: 8 }];
const defaultSkillsTextStyle = [styles.textFont, { fontSize: 8 }];
@@ -213,12 +215,20 @@ const GroupTestReport = ({
customStyles.tableCellHighlight,
]}
>
<Text style={customStyles.tableCell}>Sr</Text>
<Text style={[customStyles.tableCell, { maxWidth: "24px" }]}>
Sr
</Text>
<Text style={customStyles.tableCell}>Candidate Name</Text>
<Text style={customStyles.tableCell}>Email ID</Text>
<Text style={customStyles.tableCell}>Gender</Text>
<Text style={customStyles.tableCell}>Date of test</Text>
<Text style={customStyles.tableCell}>Result</Text>
<Text style={[customStyles.tableCell, { maxWidth: "48px" }]}>
Gender
</Text>
<Text style={[customStyles.tableCell, { maxWidth: "64px" }]}>
Date of test
</Text>
<Text style={[customStyles.tableCell, { maxWidth: "48px" }]}>
Result
</Text>
<Text style={customStyles.tableCell}>Level</Text>
</View>
{studentsData.map(
@@ -228,15 +238,22 @@ const GroupTestReport = ({
style={[
customStyles.tableCell,
customStyles.tableCellHighlight,
{ maxWidth: "24px" },
]}
>
{index + 1}
</Text>
<Text style={customStyles.tableCell}>{name}</Text>
<Text style={customStyles.tableCell}>{email}</Text>
<Text style={customStyles.tableCell}>{gender}</Text>
<Text style={customStyles.tableCell}>{date}</Text>
<Text style={customStyles.tableCell}>{result}</Text>
<Text style={[customStyles.tableCell, { maxWidth: "48px" }]}>
{gender}
</Text>
<Text style={[customStyles.tableCell, { maxWidth: "64px" }]}>
{date}
</Text>
<Text style={[customStyles.tableCell, { maxWidth: "48px" }]}>
{result}
</Text>
<Text style={customStyles.tableCell}>{level}</Text>
</View>
)