import { For, createSignal } from 'solid-js'; interface InvoiceItem { description: string; quantity: number; unitPrice: number; total: number; } interface InvoiceData { invoiceNumber: string; date: string; dueDate: string; companyName: string; companyAddress: string; companyPhone: string; companyEmail: string; clientName: string; clientAddress: string; items: InvoiceItem[]; subtotal: number; taxRate: number; taxAmount: number; total: number; } function Invoice() { const [invoiceData] = createSignal({ invoiceNumber: 'INV-2024-001', date: '2024-01-15', dueDate: '2024-02-15', companyName: 'Your Company Name', companyAddress: '123 Business Street\nSuite 100\nCity, State 12345', companyPhone: '(555) 123-4567', companyEmail: 'billing@yourcompany.com', clientName: 'Client Company Inc.', clientAddress: '456 Client Avenue\nBuilding B\nClient City, State 67890', items: [ { description: 'Web Development Services', quantity: 40, unitPrice: 75.00, total: 3000.00 }, { description: 'UI/UX Design', quantity: 20, unitPrice: 85.00, total: 1700.00 }, { description: 'Project Management', quantity: 15, unitPrice: 60.00, total: 900.00 } ], subtotal: 5600.00, taxRate: 0.08, taxAmount: 448.00, total: 6048.00 }); const data = invoiceData(); return (
{/* Header */}

{data.companyName}

{data.companyAddress}

Phone: {data.companyPhone}

Email: {data.companyEmail}

INVOICE

Invoice #: {data.invoiceNumber}
Date: {data.date}
Due Date: {data.dueDate}
{/* Bill To Section */}

Bill To:

{data.clientAddress}

Client:

{data.clientName}

{/* Items Table */} {(item) => ( )}
Description Qty Unit Price Total
{item.description} {item.quantity} ${item.unitPrice.toFixed(2)} ${item.total.toFixed(2)}
{/* Totals */}
Subtotal: ${data.subtotal.toFixed(2)}
Tax ({(data.taxRate * 100).toFixed(1)}%): ${data.taxAmount.toFixed(2)}
Total: ${data.total.toFixed(2)}
{/* Footer */}

Thank you for your business!
Payment is due within 30 days of invoice date.

); } export default Invoice;