@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
23 lines (21 loc) • 570 B
JavaScript
import * as React from "react";
import ActiveButton from "./ActiveButton";
import PageButtonLink from "./PageButtonLink";
const Pages = ({
pageCount,
selectedPage,
onPageChange,
enlargement = 1,
size
}) => Array(...Array(pageCount)).map((_, index) => {
const key = index + enlargement;
return selectedPage === key ? /*#__PURE__*/React.createElement(ActiveButton, {
key: key,
size: size
}, key) : /*#__PURE__*/React.createElement(PageButtonLink, {
key: key,
onPageChange: onPageChange,
size: size
}, key);
});
export default Pages;