import { Document, Page, Text, View, StyleSheet, Font } from '@react-pdf/renderer'; // Create styles const styles = StyleSheet.create({ page: { padding: 50, fontSize: 10, color: '#333', fontFamily: 'Helvetica', }, header: { flexDirection: 'row', justifyContent: 'space-between', marginBottom: 40, }, companyInfo: { textAlign: 'right', }, title: { fontSize: 24, color: '#000', marginBottom: 20, }, section: { marginBottom: 20, }, label: { fontSize: 8, color: '#999', textTransform: 'uppercase', marginBottom: 2, }, table: { width: 'auto', borderStyle: 'solid', borderWidth: 1, borderColor: '#eee', borderRightWidth: 0, borderBottomWidth: 0, marginBottom: 20, }, tableRow: { margin: 'auto', flexDirection: 'row', }, tableCol: { width: '60%', borderStyle: 'solid', borderWidth: 1, borderColor: '#eee', borderLeftWidth: 0, borderTopWidth: 0, padding: 8, }, tableColPrice: { width: '40%', borderStyle: 'solid', borderWidth: 1, borderColor: '#eee', borderLeftWidth: 0, borderTopWidth: 0, padding: 8, textAlign: 'right', }, tableCell: { margin: 'auto', marginTop: 5, fontSize: 10, }, total: { flexDirection: 'row', justifyContent: 'flex-end', marginTop: 20, borderTop: 1, borderColor: '#000', paddingTop: 10, }, totalLabel: { fontSize: 14, fontWeight: 'bold', }, footer: { position: 'absolute', bottom: 30, left: 50, right: 50, textAlign: 'center', color: '#999', fontSize: 8, borderTop: 1, borderColor: '#eee', paddingTop: 10, }, }); export const InvoicePDF = ({ order, product, modules, customer }: any) => ( CASPOS Software Solutions CASPOS GmbH Musterstraße 1 12345 Musterstadt Deutschland Bestellbestätigung / Rechnung Rechnungsempfänger {customer.company_name} {customer.first_name} {customer.last_name} {customer.address} {customer.zip_code} {customer.city} USt-IdNr: {customer.vat_id} Bestelldetails Bestellnummer: {order.id} Datum: {new Date().toLocaleDateString('de-DE')} Beschreibung Preis (mtl.) {product.name} (Basispaket) {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(product.base_price)} {modules.map((mod: any) => ( {mod.name} +{new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(mod.additional_price)} ))} Zwischensumme: {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(order.total_amount)} Gesamtbetrag: {new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(order.total_amount)} Vielen Dank für Ihre Bestellung! Dies ist ein automatisch generiertes Dokument. );