From 30fba5afbf70792cecc750af30b1c4ce4b87e7ae Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Fri, 7 Jun 2024 14:48:55 +0200 Subject: [PATCH] misc: add default empty state in credit note list page --- ditto/base.json | 2 ++ .../customers/creditNotes/CreditNotesList.tsx | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ditto/base.json b/ditto/base.json index 9a8f37b58..b4ec1093e 100644 --- a/ditto/base.json +++ b/ditto/base.json @@ -942,6 +942,8 @@ "text_664f3562b7caf600e5246883": "Member role has been edited", "text_665edfd17997c0006f09cdb2": "Unlock all roles", "text_665edfd17997c0006f09cdb3": "Give specific access to your members", + "text_6663014df0a6be0098264dd9": "There are no credit notes", + "text_6663014df0a6be0098264dda": "A credit note serves as a document issued by you to a customer, reducing the amount owed by your organization on a specific invoice. Please create an invoice to generate credit notes.", "text_64c7a89b6c67eb6c98898167": "Net payment term", "text_64c7a89b6c67eb6c98898182": "Period within which a customer is expected to pay for an invoice after it has been issued.\nNeed more flexibility? Set a payment term at the customer level to override the one above.", "text_64c7a89b6c67eb6c988980eb": "The duration within which a customer is expected to remit payment after the invoice is issued. Note that it may impact all invoices already in draft.", diff --git a/src/components/customers/creditNotes/CreditNotesList.tsx b/src/components/customers/creditNotes/CreditNotesList.tsx index d5a668a36..27179fee8 100644 --- a/src/components/customers/creditNotes/CreditNotesList.tsx +++ b/src/components/customers/creditNotes/CreditNotesList.tsx @@ -144,12 +144,22 @@ const CreditNotesList = memo( ))} - ) : !loading && hasSearchQuery && !creditNotes?.length ? ( - } - /> + ) : !loading && !creditNotes?.length ? ( + <> + {hasSearchQuery ? ( + } + /> + ) : ( + } + /> + )} + ) : ( {