From 762821e0ed7e1935086f9c83e7f0e01966031ce5 Mon Sep 17 00:00:00 2001 From: ledouxm Date: Tue, 12 Nov 2024 09:42:30 +0100 Subject: [PATCH] feat(pdf): break page before pictures --- packages/pdf/src/report.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/pdf/src/report.tsx b/packages/pdf/src/report.tsx index 89faf7a..e53f713 100644 --- a/packages/pdf/src/report.tsx +++ b/packages/pdf/src/report.tsx @@ -1,4 +1,4 @@ -import { Document, Font, Page } from "@react-pdf/renderer"; +import { Document, Font, Image, Page, View } from "@react-pdf/renderer"; import { Html } from "react-pdf-html"; import React from "react"; import type { Udap, Report, Service_instructeurs, Clause_v2, Pictures } from "@cr-vif/electric-client/frontend"; @@ -150,19 +150,19 @@ export const ReportPDFDocument = ({ udap, htmlString, images, pictures }: Report
${htmlString}
- ${ - pictures - ? `
- ${pictures - .filter((pic) => !!pic.url) - .map((pic) => ``) - .join("")} -
` - : "" - } + `} + {pictures ? ( + + {pictures + .filter((pic) => !!pic.url) + .map((pic) => ( + + ))} + + ) : null} );