fix: fix app table footer label when -1

This commit is contained in:
Ruben Fiszel
2023-08-26 12:13:22 +02:00
parent 47be3cb9e5
commit 1e156499de
2 changed files with 4 additions and 3 deletions
@@ -102,7 +102,8 @@
{/if}
</div>
</Button>
{$table.getState().pagination.pageIndex + 1} of {$table.getPageCount()}
{$table.getState().pagination.pageIndex + 1}
{$table.getPageCount() > 0 ? ` of ${$table.getPageCount()}` : ''}
</div>
{:else}
<div />
@@ -204,7 +204,7 @@
page = page + 1
outputs?.page.set(page, true)
}}
disabled={pagination.disableNext}
disabled={pagination.disableNext && pagination.total > 0}
>
<div class="flex flex-row gap-1 items-center">
Next
@@ -216,7 +216,7 @@
{/if}
</div>
</Button>
<div class="text-xs">{page + 1} of {pagination.total}</div>
<div class="text-xs">{page + 1} {pagination.total > 0 ? `of ${pagination.total}` : ''}</div>
</div>
{/if}
</div>