"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
            t[p[i]] = s[p[i]];
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var FaChevronLeft = require("react-icons/lib/fa/chevron-left");
var FaChevronRight = require("react-icons/lib/fa/chevron-right");
var __1 = require("../");
var Button_1 = require("./Button");
var Grid_1 = require("./Grid");
var Txt_1 = require("./Txt");
var Pager = function (_a) {
    var totalItems = _a.totalItems, itemsPerPage = _a.itemsPerPage, page = _a.page, nextPage = _a.nextPage, prevPage = _a.prevPage, props = __rest(_a, ["totalItems", "itemsPerPage", "page", "nextPage", "prevPage"]);
    var lowerBound = page * itemsPerPage;
    var upperBound = Math.min((page + 1) * itemsPerPage, totalItems);
    return (React.createElement(Grid_1.Flex, __assign({ justifyContent: "flex-end", alignItems: "center" }, props),
        React.createElement(Txt_1.default, { mr: 2 },
            React.createElement("strong", null,
                lowerBound + 1,
                " - ",
                upperBound),
            ' ',
            "of ",
            React.createElement("strong", null, totalItems)),
        React.createElement(Grid_1.Flex, null,
            React.createElement(__1.ButtonGroup, null,
                React.createElement(Button_1.default, { className: "rendition-pager__btn--prev", disabled: totalItems <= itemsPerPage || page <= 0, onClick: function () { return prevPage(); }, icon: React.createElement(FaChevronLeft, null) }),
                React.createElement(Button_1.default, { className: "rendition-pager__btn--next", disabled: totalItems <= itemsPerPage ||
                        totalItems / itemsPerPage <= page + 1, onClick: function () { return nextPage(); }, icon: React.createElement(FaChevronRight, null) })))));
};
exports.default = Pager;
