import React from "react"; import { Page, Text, View, Document, StyleSheet, Image, } from "@react-pdf/renderer"; // Create styles const styles = StyleSheet.create({ page: { flexDirection: "column", backgroundColor: "white", padding: 20, }, sectionTitle: { textAlign: "center", fontSize: 16, fontWeight: "bold", marginBottom: 10, }, section: { margin: 10, padding: 10, }, viewer: { width: "75vw", // Full width height: "100vh", // Full height }, cardContainer: { flexDirection: "row", justifyContent: "space-between", marginVertical: 10, }, card: { width: "45%", padding: 10, backgroundColor: "#f8e7d1", borderRadius: 5, textAlign: "center", fontSize: 14, fontWeight: "bold", }, chartContainer: { marginVertical: 20, textAlign: "center", }, table: { display: "table", width: "auto", borderStyle: "solid", borderWidth: 1, borderColor: "#bfbfbf", borderBottomWidth: 0, borderRightWidth: 0, }, tableRow: { flexDirection: "row", }, tableColHeader: { width: "25%", borderStyle: "solid", borderColor: "#bfbfbf", borderRightWidth: 1, borderBottomWidth: 1, backgroundColor: "#f2f2f2", padding: 5, textAlign: "center", }, tableCol: { width: "25%", borderStyle: "solid", borderColor: "#bfbfbf", borderRightWidth: 1, borderBottomWidth: 1, padding: 5, textAlign: "center", }, tableCellHeader: { margin: 5, fontSize: 12, fontWeight: "bold", }, tableCell: { margin: 5, fontSize: 10, }, image: { width: 400, height: 300, }, }); // Create Document Component const ReportPDF = ({ tableData, chartImages }) => { return ( {/* Title */} Travel Policy Report {/* Summary Cards */} {/* Total Funds Deployed 12,23,234 Enrollment Rate 90% */} {/* Table */} ID Stream Scholarship Funds {tableData?.map((row) => ( {row.id} {row.Stream} {row.Scholarship} {row.Funds} ))} {/* Charts */} {chartImages?.barChart && ( )} {chartImages?.pieChart1 && ( )} {chartImages?.pieChart2 && ( )} ); }; export default ReportPDF;