diff --git a/src/components/Pagination.astro b/src/components/Pagination.astro index 4cea6fc..282fb5c 100644 --- a/src/components/Pagination.astro +++ b/src/components/Pagination.astro @@ -1,49 +1,43 @@ --- +import type { Page } from "astro"; import LinkButton from "./LinkButton.astro"; +import type { CollectionEntry } from "astro:content"; export interface Props { - currentPage: number; - totalPages: number; - prevUrl: string; - nextUrl: string; + page: Page>; } -const { currentPage, totalPages, prevUrl, nextUrl } = Astro.props; - -const prev = currentPage > 1 ? "" : "disabled"; -const next = currentPage < totalPages ? "" : "disabled"; -const isPrevDisabled = prev === "disabled"; -const isNextDisabled = next === "disabled"; +const { page } = Astro.props; --- { - totalPages > 1 && ( + page.lastPage > 1 && (