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(
  • Previous
  • ); } else { liElements.push(
  • Previous
  • ); } } else if (v.type == "next") { if (v.link == null) { liElements.push(
  • Next
  • ); } else { liElements.push(
  • Next
  • ); } } else if (v.type == "num") { if (v.link == null) { if (v.num == now) { liElements.push(
  • {v.num}
  • ); } else { liElements.push(
  • {v.num}
  • ); } } else { liElements.push(
  • {v.num}
  • ); } } else if (v.type == "sp") {
  • ...
  • } } return ( ); }