import { Button, Intent } from '@blueprintjs/core'; import { css } from '@emotion/css'; import { x } from '@xstyled/emotion'; import { lighten } from 'polished'; import { Group, Stack, StackProps } from '@/components'; export interface InvoiceMailReceiptProps extends StackProps { // # Company companyName: string; companyLogoUri?: string; // # Colors primaryColor?: string; // # Due date dueDate: string; dueDateLabel?: string; // # Due amount dueAmountLabel?: string; dueAmount: string; // # Total total: string; totalLabel?: string; // # Invoice number invoiceNumber: string; invoiceNumberLabel?: string; // # Mail message message: string; // # Invoice items items?: Array<{ label: string; total: string; quantity: string | number }>; // # View invoice button showViewInvoiceButton?: boolean; viewInvoiceButtonLabel?: string; viewInvoiceButtonOnClick?: () => void; } export function InvoiceMailReceipt({ // # Company companyName, companyLogoUri, // # Colors primaryColor = 'rgb(0, 82, 204)', // # Due date dueDate, dueDateLabel = 'Due', // # Due amount dueAmountLabel = 'Due Amount', dueAmount, // # Total total, totalLabel = 'Total', // # Invoice number invoiceNumber, invoiceNumberLabel = 'Invoice #', // # Invoice message message, // # Invoice items items, // # View invoice button showViewInvoiceButton = true, viewInvoiceButtonLabel = 'View Invoice', viewInvoiceButtonOnClick, ...restProps }: InvoiceMailReceiptProps) { return ( {companyLogoUri && ( )} {companyName} {total} {invoiceNumberLabel} {invoiceNumber} {dueDateLabel} {dueDate} {message} {showViewInvoiceButton && ( )} {items?.map((item, key) => ( {item.label} {item.quantity} x {item.total} ))} {totalLabel} {total} {dueAmountLabel} {dueAmount} ); }