fui-fancyui
Version:
FancyUI Libary
26 lines (25 loc) • 933 B
JavaScript
"use client";
import { jsxs as h, jsx as i } from "react/jsx-runtime";
import l, { useState as x } from "react";
import L from "../Paginator/Paginator.js";
import { Wrapper as y, StyledList as C } from "./FancyPageList.style.js";
function I(s) {
const { itemsPerPage: e = 20, elements: t, spacingBetweenItems: c, buttonDesign: g, outlinedButton: m, showPages: p = 3 } = s, [o, u] = x(1), P = Math.ceil((t == null ? void 0 : t.length) / e), r = o * e, d = r - e, n = t == null ? void 0 : t.slice(d, r);
return /* @__PURE__ */ h(y, { children: [
/* @__PURE__ */ i(C, { $spacing: c, children: n == null ? void 0 : n.map((a, f) => /* @__PURE__ */ i(l.Fragment, { children: a }, f)) }),
/* @__PURE__ */ i(
L,
{
currentPage: o,
showPages: p,
pageLimits: P,
onPageChange: (a) => u(a),
themeType: g,
outlinedButton: m
}
)
] });
}
export {
I as default
};