Refactor pagination logic in identities page

This commit is contained in:
luke-hagar-sp
2024-01-23 13:15:48 -06:00
parent e69949a7bf
commit 2f23f1d906

View File

@@ -27,6 +27,7 @@
<div class="card flex justify-center flex-col align-middle"> <div class="card flex justify-center flex-col align-middle">
{#await data.totalCount then totalCount} {#await data.totalCount then totalCount}
{#if totalCount > 250 || Number(data.params.limit) < totalCount}
<Paginator <Paginator
{onAmountChange} {onAmountChange}
{onGo} {onGo}
@@ -41,9 +42,12 @@
{sorters} {sorters}
{totalCount} {totalCount}
/> />
{/if}
{/await} {/await}
{#await data.identities} {#await data.identities}
<Progress /> <div class="grid h-full place-content-center p-8">
<Progress width="w-[100px]" />
</div>
{:then identities} {:then identities}
<div class="table-container"> <div class="table-container">
<table class="table"> <table class="table">
@@ -99,6 +103,7 @@
</div> </div>
{/await} {/await}
{#await data.totalCount then totalCount} {#await data.totalCount then totalCount}
{#if totalCount > 250 || Number(data.params.limit) < totalCount}
<Paginator <Paginator
{onAmountChange} {onAmountChange}
{onGo} {onGo}
@@ -113,5 +118,6 @@
{sorters} {sorters}
{totalCount} {totalCount}
/> />
{/if}
{/await} {/await}
</div> </div>