@idares-ui/react
Version:
19 lines • 864 B
JavaScript
import * as React from "react";
import { useContext } from "react";
import { MainContext } from "../utils/context";
import PaginationButton from "./PaginationButton";
/**
* Pagination Simple mode
*
* @returns Simple Pagination Component
*/
var SimpleMode = function () {
var _a = useContext(MainContext), numberOfPages = _a.numberOfPages, page = _a.page;
return (React.createElement(React.Fragment, null, new Array(numberOfPages).fill(1).map(function (_, i) {
var itemValue = i + 1;
var isActive = itemValue === page;
return (React.createElement(PaginationButton, { key: itemValue, active: itemValue === page, title: itemValue, value: itemValue, "aria-label": "Page ".concat(itemValue).concat(isActive ? ", current page" : "") }));
})));
};
export default SimpleMode;
//# sourceMappingURL=SimpleMode.js.map