UNPKG

fui-fancyui

Version:
57 lines (56 loc) 1.66 kB
"use client"; import { jsxs as p, jsx as t } from "react/jsx-runtime"; import { useMemo as f } from "react"; import h from "../../icons/SVGChevronLeft/SVGChevronLeft.js"; import g from "../../icons/SVGChevronRight/SVGChevronRight.js"; import y from "../../atoms/PageNumberList/PageNumberList.js"; import l from "../../organisms/FancyButton/FancyButton.js"; import { StyledPaginator as b, IconWrapper as s, NumberList as L } from "./Paginator.style.js"; function j(c) { const { currentPage: i = 1, showPages: r = 3, onPageChange: e, outlinedButton: n, themeType: m, pageLimits: o, numberButtonStyle: d, ...a } = c, u = f( () => y({ showPages: r, currentPage: i, pageHandler: e, pageLimits: o, numberButtonStyle: d }), // eslint-disable-next-line react-hooks/exhaustive-deps [r, i, e, o] ); return /* @__PURE__ */ p(b, { ...a, children: [ /* @__PURE__ */ t( l, { sizeC: "md", themeType: m ?? "accent", outlined: n, wide: !1, oneToOne: !0, icon: /* @__PURE__ */ t(s, { $align: "left", children: /* @__PURE__ */ t(h, {}) }), onClick: () => e == null ? void 0 : e(i - 1), disabled: i === 1 } ), /* @__PURE__ */ t(L, { children: u }), /* @__PURE__ */ t( l, { wide: !1, oneToOne: !0, themeType: m ?? "accent", outlined: n, icon: /* @__PURE__ */ t(s, { $align: "right", children: /* @__PURE__ */ t(g, {}) }), sizeC: "md", onClick: () => e == null ? void 0 : e(i + 1), disabled: i === o } ) ] }); } export { j as default };