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