"use client"; import * as React from "react"; import { Page as PDFPage, Document as PDFDocument, Image as PDFImage, StyleSheet, View as PDFView, Text as PDFText, } from "@react-pdf/renderer"; import { FrontPageModule, SitemapModule, EstimationModule, TransparenzModule, ClosingModule, SimpleLayout, pdfStyles, calculatePositions, } from "@mintel/pdf"; // Local styles for QR Code overlay const styles = StyleSheet.create({ qrContainer: { position: "absolute", bottom: 40, right: 40, width: 60, height: 60, alignItems: "center", justifyContent: "center", }, qrImage: { width: "100%", height: "100%", }, qrLabel: { fontSize: 8, color: "#94a3b8", // slate-400 marginTop: 4, textAlign: "center", }, }); interface PDFProps { state: any; totalPrice: number; monthlyPrice?: number; totalPagesCount?: number; pricing: any; headerIcon?: string; footerLogo?: string; qrCodeData?: string; } export const LocalEstimationPDF = ({ state, totalPrice, pricing, headerIcon, footerLogo, qrCodeData, }: PDFProps) => { const date = new Date().toLocaleDateString("de-DE", { year: "numeric", month: "long", day: "numeric", }); const positions = calculatePositions(state, pricing); const companyData = { name: "Marc Mintel", address1: "Georg-Meistermann-Straße 7", address2: "54586 Schüller", ustId: "DE367588065", }; const commonProps = { state, date, icon: headerIcon, footerLogo, companyData, }; let pageCounter = 1; const getPageNum = () => (pageCounter++).toString().padStart(2, "0"); return ( {qrCodeData && ( Scan me )} {/* BriefingModule Page REMOVED as per user request ("die zweite seite ist leer, weg damit") */} {state.sitemap && state.sitemap.length > 0 && ( // @ts-ignore )} {/* @ts-ignore */} {/* @ts-ignore */} {/* @ts-ignore */} ); };