import { Box, Stack } from '@/components'; import { PaperTemplate, PaperTemplateProps, } from '../../Invoices/InvoiceCustomize/PaperTemplate'; import { DefaultPdfTemplateTerms, DefaultPdfTemplateItemDescription, DefaultPdfTemplateStatement, DefaultPdfTemplateItemName, DefaultPdfTemplateAddressBilledTo, DefaultPdfTemplateAddressBilledFrom, } from '@/constants/PdfTemplates'; export interface EstimatePaperTemplateProps extends PaperTemplateProps { // # Estimate number estimateNumebr?: string; estimateNumberLabel?: string; showEstimateNumber?: boolean; // # Expiration date expirationDate?: string; showExpirationDate?: boolean; expirationDateLabel?: string; // # Estimate date estimateDateLabel?: string; showEstimateDate?: boolean; estimateDate?: string; // # Customer name companyName?: string; // Address showBilledToAddress?: boolean; billedToAddress?: string; showBilledFromAddress?: boolean; billedFromAddress?: string; billedToLabel?: string; // Totals total?: string; showTotal?: boolean; totalLabel?: string; subtotal?: string; showSubtotal?: boolean; subtotalLabel?: string; // # Statements showCustomerNote?: boolean; customerNote?: string; customerNoteLabel?: string; // # Terms & conditions showTermsConditions?: boolean; termsConditions?: string; termsConditionsLabel?: string; lines?: Array<{ item: string; description: string; rate: string; quantity: string; total: string; }>; } export function EstimatePaperTemplate({ primaryColor, secondaryColor, showCompanyLogo = true, companyLogoUri = '', companyName, // # Address billedToAddress = DefaultPdfTemplateAddressBilledTo, billedFromAddress = DefaultPdfTemplateAddressBilledFrom, showBilledFromAddress = true, showBilledToAddress = true, billedToLabel = 'Billed To', // #Total total = '$1000.00', totalLabel = 'Total', showTotal = true, subtotal = '1000/00', subtotalLabel = 'Subtotal', showSubtotal = true, // # Customer Note showCustomerNote = true, customerNote = DefaultPdfTemplateStatement, customerNoteLabel = 'Customer Note', // # Terms & Conditions showTermsConditions = true, termsConditions = DefaultPdfTemplateTerms, termsConditionsLabel = 'Terms & Conditions', lines = [ { item: DefaultPdfTemplateItemName, description: DefaultPdfTemplateItemDescription, rate: '1', quantity: '1000', total: '$1000.00', }, ], showEstimateNumber = true, estimateNumberLabel = 'Estimate Number', estimateNumebr = '346D3D40-0001', estimateDate = 'September 3, 2024', showEstimateDate = true, estimateDateLabel = 'Estimate Date', expirationDateLabel = 'Expiration Date', showExpirationDate = true, expirationDate = 'September 3, 2024', }: EstimatePaperTemplateProps) { return ( {showEstimateNumber && ( {estimateNumebr} )} {showEstimateDate && ( {estimateDate} )} {showExpirationDate && ( {expirationDate} )} {showBilledFromAddress && ( {companyName} )} {showBilledToAddress && ( {billedToLabel} )} {showSubtotal && ( )} {showTotal && ( )} {showCustomerNote && ( {customerNote} )} {showTermsConditions && ( {termsConditions} )} ); }