diff --git a/apps/temp-docs/components/pagination.tsx b/apps/temp-docs/components/pagination.tsx index 44758cfee6e..61cb5db6a87 100644 --- a/apps/temp-docs/components/pagination.tsx +++ b/apps/temp-docs/components/pagination.tsx @@ -1,41 +1,36 @@ import Link from 'next/link' -import { useRouter } from 'next/router' +import { IconArrowLeft, IconArrowRight } from '@supabase/ui' + +const pagination = ({ currentPage, totalCount }: { currentPage: number, totalCount: number }) => { + // TODO: not sure if this is the most efficient way to do this. may need to refactor. + const totalArray = Array.from({ length: totalCount }, (_, i: number) => i + 1) + const pages = totalArray.filter((page: number) => { + return page >= currentPage - 2 && page <= currentPage + 2 + }) -const pagination = () => { - const router = useRouter() - const Page: any = router.query.page || 1 - const page = parseInt(Page) return (