From 51c57eb87ce51107d3032ea7572f009c9fe64fee Mon Sep 17 00:00:00 2001 From: Darshan Date: Thu, 2 Jan 2025 14:02:02 +0530 Subject: [PATCH] address comment. --- src/lib/components/pagination.svelte | 94 +--------------------------- 1 file changed, 2 insertions(+), 92 deletions(-) diff --git a/src/lib/components/pagination.svelte b/src/lib/components/pagination.svelte index 65968e4ed..814f5801d 100644 --- a/src/lib/components/pagination.svelte +++ b/src/lib/components/pagination.svelte @@ -5,30 +5,11 @@ export let sum: number; export let limit: number; export let offset: number; + // eslint-disable-next-line svelte/valid-compile export let hidePages = false; $: currentPage = Math.floor(offset / limit + 1); - // TODO: check if we even need these now due to Pink V2. - /*$: totalPages = Math.ceil(sum / limit); - $: pages = pagination(currentPage, totalPages); - function pagination(page: number, total: number) { - const pagesShown = 5; - const start = Math.max( - 1, - Math.min(page - Math.floor((pagesShown - 3) / 2), total - pagesShown + 2) - ); - const end = Math.min( - total, - Math.max(page + Math.floor((pagesShown - 2) / 2), pagesShown - 1) - ); - return [ - ...(start > 2 ? [1, '...'] : start > 1 ? [1] : []), - ...Array.from({ length: end + 1 - start }, (_, i) => i + start), - ...(end < total - 1 ? ['...', total] : end < total ? [total] : []) - ]; - }*/ - function getLink(page: number): string { const url = new URL($pageStore.url); if (page === 1) { @@ -41,75 +22,4 @@ } - - + \ No newline at end of file