import PropTypes from 'prop-types' import { Text, View, Image } from '@react-pdf/renderer' import React from 'react' import { styles } from './styles' import { PdfContainer } from '../PdfContainer' export const PdfSalesInvoice = ({ data, numberFormat = (number) => { return number } }) => { const { date, products, total, client, change, storePhone, srcLogo, addressStore, storeName, NitStore } = data || {} const { ccClient, clientName, clientNumber } = client || {} return ( {storeName} {addressStore} Teléfono: {storePhone} Factura de Venta Fecha: {date} NIT: {NitStore} Nombre del Cliente: {clientName} CC del Cliente: {ccClient} Teléfono del Cliente: {clientNumber} Productos Nombre Cantidad Precio Unitario Total {products?.map(product => {return ( {product.pName} {product.ProQuantity} {numberFormat(product.unitPrice)} {numberFormat(product.ProPrice)} )})} Total: {total} {change && Cambio: {change}} ) } PdfSalesInvoice.propTypes = { data: PropTypes.object, numberFormat: PropTypes.func }