UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

23 lines (22 loc) 826 B
import { useMemo as a } from "../../../../external/preact/hooks/dist/hooks.module.js"; import d from "./usePagination.js"; import { isString as i, isUndefined as f } from "../../../../utils/value/is.js"; const C = (n) => i(n.next), h = (n) => i(n.prev), S = (n, u) => { const c = a(() => { const e = [], P = () => e.length, g = () => { e.length = 0; }, m = (t) => ({ cursor: e[t - 1] }), s = (t, r) => { const o = e[r - 1]; (r === 1 || r === (e.length || 1) + 1) && f(o) && (e[r - 1] = t ? decodeURIComponent(t) : void 0); }; return { getPageCount: P, getPageParams: m, resetPageCount: g, updatePagination: (t, r, o) => { C(o) && s(o.next, t + 1), h(o) && s(o.prev, t - 1); } }; }, []); return d(c, n, u); }; export { S as default, C as hasNextPage, h as hasPrevPage };