This commit is contained in:
@@ -15,6 +15,11 @@ interface InvoiceItem {
|
||||
interface Client {
|
||||
name: string;
|
||||
email: string | null;
|
||||
street: string | null;
|
||||
city: string | null;
|
||||
state: string | null;
|
||||
zip: string | null;
|
||||
country: string | null;
|
||||
}
|
||||
|
||||
interface Organization {
|
||||
@@ -154,6 +159,11 @@ const styles = {
|
||||
fontSize: 10,
|
||||
color: "#6B7280",
|
||||
} as Style,
|
||||
clientAddress: {
|
||||
fontSize: 10,
|
||||
color: "#6B7280",
|
||||
lineHeight: 1.5,
|
||||
} as Style,
|
||||
table: {
|
||||
marginBottom: 40,
|
||||
} as Style,
|
||||
@@ -399,6 +409,28 @@ export function createInvoiceDocument(props: InvoiceDocumentProps) {
|
||||
[
|
||||
h(Text, { style: styles.sectionLabel }, "Bill To"),
|
||||
h(Text, { style: styles.clientName }, client.name),
|
||||
client.street ||
|
||||
client.city ||
|
||||
client.state ||
|
||||
client.zip ||
|
||||
client.country
|
||||
? h(
|
||||
View,
|
||||
{ style: styles.clientAddress },
|
||||
[
|
||||
client.street ? h(Text, client.street) : null,
|
||||
client.city || client.state || client.zip
|
||||
? h(
|
||||
Text,
|
||||
[client.city, client.state, client.zip]
|
||||
.filter(Boolean)
|
||||
.join(", "),
|
||||
)
|
||||
: null,
|
||||
client.country ? h(Text, client.country) : null,
|
||||
].filter(Boolean),
|
||||
)
|
||||
: null,
|
||||
client.email
|
||||
? h(Text, { style: styles.clientEmail }, client.email)
|
||||
: null,
|
||||
|
||||
Reference in New Issue
Block a user