From 70151490bd79d38f8064b720fc124d1774a18235 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 5 Apr 2024 10:30:19 -0300
Subject: fix listing, add cache invalidation, fix codec for accounts

---
 .../src/paths/instance/webhooks/list/Table.tsx         | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

(limited to 'packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx')

diff --git a/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx b/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx
index 2cafc7f9a..919285e78 100644
--- a/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx
+++ b/packages/merchant-backoffice-ui/src/paths/instance/webhooks/list/Table.tsx
@@ -32,8 +32,6 @@ interface Props {
   onSelect: (e: Entity) => void;
   onCreate: () => void;
   onLoadMoreBefore?: () => void;
-  hasMoreBefore?: boolean;
-  hasMoreAfter?: boolean;
   onLoadMoreAfter?: () => void;
 }
 
@@ -44,8 +42,6 @@ export function CardTable({
   onSelect,
   onLoadMoreAfter,
   onLoadMoreBefore,
-  hasMoreAfter,
-  hasMoreBefore,
 }: Props): VNode {
   const [rowSelection, rowSelectionHandler] = useState<string[]>([]);
 
@@ -85,8 +81,6 @@ export function CardTable({
                 rowSelectionHandler={rowSelectionHandler}
                 onLoadMoreAfter={onLoadMoreAfter}
                 onLoadMoreBefore={onLoadMoreBefore}
-                hasMoreAfter={hasMoreAfter}
-                hasMoreBefore={hasMoreBefore}
               />
             ) : (
               <EmptyTable />
@@ -104,8 +98,6 @@ interface TableProps {
   onSelect: (e: Entity) => void;
   rowSelectionHandler: StateUpdater<string[]>;
   onLoadMoreBefore?: () => void;
-  hasMoreBefore?: boolean;
-  hasMoreAfter?: boolean;
   onLoadMoreAfter?: () => void;
 }
 
@@ -115,19 +107,17 @@ function Table({
   onDelete,
   onSelect,
   onLoadMoreBefore,
-  hasMoreAfter,
-  hasMoreBefore,
 }: TableProps): VNode {
   const { i18n } = useTranslationContext();
   return (
     <div class="table-container">
-      {hasMoreBefore && (
+      {onLoadMoreBefore && (
         <button
           class="button is-fullwidth"
           data-tooltip={i18n.str`load more webhooks before the first one`}
           onClick={onLoadMoreBefore}
         >
-          <i18n.Translate>load newer webhooks</i18n.Translate>
+          <i18n.Translate>load first page</i18n.Translate>
         </button>
       )}
       <table class="table is-fullwidth is-striped is-hoverable is-fullwidth">
@@ -181,13 +171,13 @@ function Table({
           })}
         </tbody>
       </table>
-      {hasMoreAfter && (
+      {onLoadMoreAfter && (
         <button
           class="button is-fullwidth"
           data-tooltip={i18n.str`load more webhooks after the last one`}
           onClick={onLoadMoreAfter}
         >
-          <i18n.Translate>load older webhooks</i18n.Translate>
+          <i18n.Translate>load next page</i18n.Translate>
         </button>
       )}
     </div>
-- 
cgit v1.2.3

