Don't show Load More if nothing to show

This commit is contained in:
Laurent Nguyen 2024-04-23 13:35:41 +02:00
parent b2c05fa784
commit 13462646f6

View File

@ -1459,12 +1459,12 @@ const DocumentsTabComponent: React.FunctionComponent<{
<div
className="tab-pane active"
/* data-bind="
setTemplateReady: true,
attr:{
id: tabId
},
visible: isActive"
*/
setTemplateReady: true,
attr:{
id: tabId
},
visible: isActive"
*/
role="tabpanel"
style={{ display: "flex" }}
>
@ -1553,9 +1553,9 @@ const DocumentsTabComponent: React.FunctionComponent<{
onClick={() => refreshDocumentsGrid(true)}
disabled={!applyFilterButton.enabled}
/* data-bind="
click: refreshDocumentsGrid.bind($data, true),
enable: applyFilterButton.enabled"
*/
click: refreshDocumentsGrid.bind($data, true),
enable: applyFilterButton.enabled"
*/
aria-label="Apply filter"
tabIndex={0}
>
@ -1567,9 +1567,9 @@ const DocumentsTabComponent: React.FunctionComponent<{
<button
className="filterbtnstyle queryButton"
/* data-bind="
visible: !isPreferredApiMongoDB && isExecuting,
click: onAbortQueryClick"
*/
visible: !isPreferredApiMongoDB && isExecuting,
click: onAbortQueryClick"
*/
aria-label="Cancel Query"
tabIndex={0}
>
@ -1634,14 +1634,16 @@ const DocumentsTabComponent: React.FunctionComponent<{
size={tableContainerSizePx}
columnHeaders={columnHeaders}
/>
<a
className="loadMore"
role="button"
onClick={() => loadNextPage(false)}
onKeyDown={() => loadNextPage(false)}
>
Load more
</a>
{tableItems.length > 0 && (
<a
className="loadMore"
role="button"
onClick={() => loadNextPage(false)}
onKeyDown={() => loadNextPage(false)}
>
Load more
</a>
)}
</div>
</div>
<div style={{ minWidth: "20%", width: "100%" }}>