diff --git a/components/Paginator.tsx b/components/Paginator.tsx index fe09f79..f8c2b3f 100644 --- a/components/Paginator.tsx +++ b/components/Paginator.tsx @@ -1,6 +1,6 @@ import Link from 'next/link' const Paginator = ({ currentPage, totalPage }:PaginatorProps):JSX.Element => { - const pages = [1, currentPage === 1 ? 2 : currentPage - 1, currentPage === 1 ? 3 : currentPage, currentPage + 1, totalPage ] + const pages = [1, currentPage === 1 ? 2 : currentPage - 1, currentPage === 1 ? 3 : totalPage === currentPage ? currentPage - 2 : currentPage, currentPage + 1, totalPage ] return