UNPKG

fui-fancyui

Version:
41 lines (40 loc) 1.33 kB
"use client"; import { jsx as g } from "react/jsx-runtime"; import h from "../../organisms/FancyButton/FancyButton.js"; import { Wrapper as l } from "./PageNumberList.style.js"; import { generateNumbers as C } from "./utils/generateNumbers.js"; function v(d) { const { showPages: n = 3, currentPage: c = 1, pageHandler: o, pageLimits: i = 99, numberButtonStyle: r } = d, t = C(i, c, n), f = (a, e) => { if (!o) return; const s = a.target.textContent; if (s === "..." && e === 0) { o(1); return; } if (s === "..." && e === t.length - 1) { o(i); return; } o(Number(s)); }; return /* @__PURE__ */ g(l, { children: t.map((a, e) => /* @__PURE__ */ g( h, { textColor: a !== c ? (r == null ? void 0 : r.textColor) ?? "secondary" : (r == null ? void 0 : r.textColorActive) ?? "accent", label: `${a}`, onClick: (p) => f(p, e), sizeC: "sm", oneToOne: !0, outlinedBackgroundStrength: r == null ? void 0 : r.outlinedBackgroundStrength, hoverColor: (r == null ? void 0 : r.hoverColor) ?? "secondary", layer: r == null ? void 0 : r.layer, outlined: (r == null ? void 0 : r.outlined) ?? !1, themeType: (r == null ? void 0 : r.themeType) ?? "transparent", wide: !1 }, e )) }); } export { v as default };