This commit is contained in:
quantulr
2023-11-01 17:27:06 +08:00
parent 7e465da9d2
commit 1a22404f19
87 changed files with 1604 additions and 196 deletions

View File

@ -15,24 +15,33 @@ const Pagination = ({
className={"w-full flex justify-center mt-2.5 h-10 items-center text-sm"}
>
{page <= 1 ? (
<div className={"prev mx-3"}></div>
<div className={"prev mx-3 text-gray-500 cursor-not-allowed"}>
</div>
) : (
<Link className={"next block mx-3"} href={`./${page - 1}`}>
</Link>
)}
{[...Array(pageCount)].map((el, index) => (
<div
key={index}
className={`page-item mx-3 ${
page === index + 1 ? "text-[#009fe9]" : "text-[#666666]"
}`}
>
{index + 1}
</div>
))}
{[...Array(pageCount)].map((el, index) =>
page === index + 1 ? (
<div key={index} className={`page-item mx-3 text-[#009fe9]`}>
{index + 1}
</div>
) : (
<Link
className={"page-item mx-3 text-[#666666]"}
key={index}
href={`./${index + 1}`}
>
{index + 1}
</Link>
),
)}
{page >= pageCount ? (
<div className={"next mx-3"}></div>
<div className={"next mx-3 text-gray-500 cursor-not-allowed"}>
</div>
) : (
<Link className={"next block mx-3"} href={`./${page + 1}`}>