@mitesh-bhagwant/reactjs-invoice
Version:
Invoices for React.js
75 lines (74 loc) • 1.79 kB
TypeScript
import { ReactNode } from "react";
export interface BaseButtonProps {
fileName?: string;
className?: string;
children?: ReactNode;
disabled?: boolean;
}
export interface InvoiceData {
company: {
name: string;
address?: string;
city?: string;
state?: string;
country?: string;
postalCode?: string;
phone?: string;
email?: string;
website?: string;
taxId?: string | number;
};
client: {
name?: string;
address?: string;
city?: string;
state?: string;
country: string;
postalCode?: string;
phone?: string;
email?: string;
};
invoice: {
number: string;
date: string;
dueDate?: string;
currency?: string;
amount?: string;
};
tableItems: {
[key: string]: string | number | undefined | {
innerItem1: string | number;
innerItem2?: string | number;
};
}[];
tableHeaders: string[];
totals: {
subtotal?: number | string;
tax?: number | string;
discount?: number | string;
grandTotal?: number | string;
taxPercentage?: number | string;
};
footer?: {
title?: string;
note?: string;
};
primaryColor?: string;
secondaryColor?: string;
}
export interface DownloadInvoiceButtonProps extends BaseButtonProps {
invoiceData: InvoiceData;
template?: "default" | "pro" | "modern";
}
export interface DefaultInvoiceProps {
invoiceData: InvoiceData;
}
export interface ProInvoiceProps {
logoUrl?: string;
brandColor?: string;
}
export interface ModernInvoiceProps {
logoUrl?: string;
accentColor?: string;
showQRCode?: boolean;
}