import React from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { Button } from '@/components/ui/button'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { ArrowLeft, Download, Send, DollarSign, Calendar, Phone, Mail, MapPin, CreditCard } from 'lucide-react'; const InvoiceDetail = () => { const { id } = useParams(); const navigate = useNavigate(); // Mock invoice data - in real app, fetch by ID const invoice = { id: id, invoiceNumber: 'INV-0044777', company: { name: 'ListOn', address: '1355 Market Street, Suite 900', city: 'San Francisco, CA 94103', phone: '(123) 456-7890', email: 'billing@liston.com' }, customer: { name: 'Alexander Kamin', email: 'first.last@example.com', address: '1355 Market Street, Suite 900', city: 'San Francisco, CA 94103', phone: '(123) 456-7890' }, issueDate: 'March 19th, 2017', dueDate: 'April 21th, 2017', status: 'paid', items: [ { description: 'Lorem Ipsum is simply dummy text', details: 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots', quantity: 1, unitPrice: 39.00, tax: 71.98, totalPrice: 27.98 }, { description: 'It is a long established fact that a reader will be', details: 'There are many variations of passages of Lorem Ipsum available, but the majority', quantity: 2, unitPrice: 57.00, tax: 56.80, totalPrice: 112.80 }, { description: 'The standard chunk of Lorem Ipsum used since', details: 'It has survived not only five centuries, but also the leap into electronic.', quantity: 3, unitPrice: 645.00, tax: 321.20, totalPrice: 1286.20 }, { description: 'The standard chunk of Lorem Ipsum used since', details: 'It has survived not only five centuries, but also the leap into electronic.', quantity: 3, unitPrice: 486.00, tax: 524.20, totalPrice: 789.20 } ], subtotal: 920.05, discount: 12.9, vat: 0, grandTotal: 1248.9, paymentNote: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.', thankNote: 'Thank you very much for choosing us. It was a pleasure to have worked with you.' }; const getStatusColor = (status: string) => { switch (status) { case 'paid': return 'bg-green-100 text-green-800 border-green-200'; case 'pending': return 'bg-yellow-100 text-yellow-800 border-yellow-200'; case 'overdue': return 'bg-red-100 text-red-800 border-red-200'; default: return 'bg-gray-100 text-gray-800 border-gray-200'; } }; return (
{/* Header */}
{invoice.status}
{/* Invoice Content */} {/* Invoice Header */}

ListOn.

{invoice.company.name}

{invoice.company.address}

{invoice.company.city}

P: {invoice.company.phone}

Invoice #{invoice.invoiceNumber}

Issued {invoice.issueDate}

Payment due {invoice.dueDate}

{/* Bill To Section */}

Full Name

{invoice.customer.email}

{invoice.company.name}

{invoice.company.address}

{invoice.company.city}

P: {invoice.company.phone}

{/* Items Table */}
ITEM LIST
QUANTITY
UNIT PRICE
TAX
TOTAL PRICE
{invoice.items.map((item, index) => (

{item.description}

{item.details}

{item.quantity}
${item.unitPrice.toFixed(2)}
${item.tax.toFixed(2)}
${item.totalPrice.toFixed(2)}
))}
{/* Payment Note */}

{invoice.paymentNote}

{/* Totals */}
Sub - Total amount: ${invoice.subtotal.toFixed(2)}
Discount: {invoice.discount}%
VAT: ---
Grand Total: ${invoice.grandTotal.toFixed(2)}
{/* Thank You Note */}

{invoice.thankNote}

{/* Payment Methods */}
PayPal
Visa MasterCard Maestro American Express
{/* Action Buttons */}
); }; export default InvoiceDetail;