diff --git a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte index 078990471..e6c787b0d 100644 --- a/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte +++ b/src/routes/(console)/organization-[organization]/billing/paymentHistory.svelte @@ -1,5 +1,6 @@ @@ -86,11 +95,11 @@ Due date Status Amount due - + {#if isLoadingInvoices} - {#each Array.from({ length: 2 }).keys() as index (index)} + {#each Array.from({ length: 5 }).keys() as index (index)} {#each columns as column} @@ -99,91 +108,95 @@ {/each} {/each} - {/if} - - {#each invoiceList?.invoices as invoice} - {@const status = invoice.status} - - - {toLocaleDate(invoice.dueAt)} - - - {@const isDanger = - status === 'overdue' || - status === 'failed' || - status === 'requires_authentication'} - {@const isSuccess = status === 'paid' || status === 'succeeded'} - {@const isWarning = status === 'pending'} - - - {#if invoice?.lastError} - - Details - - The scheduled payment has failed. - retryPayment(invoice)} - >Try again - - - - {/if} - - - - {formatCurrency(invoice.grossAmount)} - - - - - - - - View invoice - - - Download PDF - - {#if status === 'overdue' || status === 'failed' || status === 'abandoned'} - { - retryPayment(invoice); - trackEvent(`click_retry_payment`, { - from: 'button', - source: 'billing_invoice_menu' - }); - }}> - Retry payment - + {:else} + {#each invoiceList?.invoices as invoice (invoice.$id)} + {@const status = invoice.status} + + {toLocaleDate(invoice.dueAt)} + + {@const isDanger = + status === 'overdue' || + status === 'failed' || + status === 'requires_authentication'} + {@const isSuccess = status === 'paid' || status === 'succeeded'} + {@const isWarning = status === 'pending'} + + + {#if invoice?.lastError} + + Details + + The scheduled payment has failed. + retryPayment(invoice)} + >Try again + + + {/if} - - - - - {/each} + + + + {formatCurrency(invoice.grossAmount)} + + + + + + + + View invoice + + + Download PDF + + {#if status === 'overdue' || status === 'failed' || status === 'abandoned'} + { + retryPayment(invoice); + trackEvent(`click_retry_payment`, { + from: 'button', + source: 'billing_invoice_menu' + }); + }}> + Retry payment + + {/if} + + + + + {/each} + {/if} - {#if invoiceList.total > limit} + {#if invoiceList.total >= limit}

Total results: {invoiceList.total}

- + request()} />
{/if} {:else}