// V1 evaluation matrix page — ported from EvalReportMatrixPage.tsx import { Page, View, Text } from '@react-pdf/renderer'; import { styles, colors } from '../styles.js'; import type { MatrixData } from './types.js'; interface EvalReportMatrixPageProps { matrixData: MatrixData; pageNumber: number; } export function EvalReportMatrixPage({ matrixData, pageNumber }: EvalReportMatrixPageProps) { const { rows, evaluators, columnAverages } = matrixData; const numCol = 25; const questionCol = 160; const evalCol = 28; const scoreCol = 35; return ( {/* Header */} Evaluation Matrix Page {pageNumber} {/* Matrix Table */} {/* Table Header */} # Question {evaluators.map((ev) => ( {ev.name.split(':')[0]} ))} Score {/* Table Rows */} {rows.map((row, index) => ( {index + 1} {row.question.slice(0, 45)}{row.question.length > 45 ? '...' : ''} {evaluators.map((ev) => { const cell = row.cells[ev.key]; const hasCellData = cell !== undefined && cell !== null; const passed = hasCellData && cell.passed; return ( {hasCellData ? (passed ? 'P' : 'F') : '-'} ); })} {Math.round(row.avgScore * 100)}% ))} {/* Column Averages Row */} Pass Rate {evaluators.map((ev) => ( {Math.round((columnAverages[ev.key] || 0) * 100)}% ))} {Math.round(matrixData.overallAverage * 100)}% {/* Footer */} Indemn Evaluation Report Page {pageNumber} ); }