From 4ee67d66be5f83db09b66fb61dcbeb2739d633e0 Mon Sep 17 00:00:00 2001 From: Fushihara <1039534+fushihara@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:12:43 +0900 Subject: =?UTF-8?q?=E8=A8=98=E4=BA=8B=E3=82=92=E3=82=BF=E3=82=B0=E3=81=A7?= =?UTF-8?q?=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=82=93=E3=81=A0=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=82=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=B3=E3=82=B0?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/article/_components/pagenationElement.tsx | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 src/app/article/_components/pagenationElement.tsx (limited to 'src/app/article/_components') diff --git a/src/app/article/_components/pagenationElement.tsx b/src/app/article/_components/pagenationElement.tsx new file mode 100644 index 0000000..79191bc --- /dev/null +++ b/src/app/article/_components/pagenationElement.tsx @@ -0,0 +1,100 @@ +import Link from "next/link"; +import { createPagenation } from "../../../util/pagenation"; + +export function pagenationElement(now: number, max: number, getHrefBuilder: (page: number) => string) { + const pagenationData = createPagenation({ now: now, max: max, between: 2 }); + const liElements: JSX.Element[] = []; + for (const v of pagenationData) { + if (v.type == "back") { + if (v.link == null) { + liElements.push( +