"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __assign = (this && this.__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;
};
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 fa_1 = require("react-icons/lib/fa");
var styled_components_1 = require("styled-components");
var Button_1 = require("./Button");
var Grid_1 = require("./Grid");
var Txt_1 = require("./Txt");
var ButtonGroup = styled_components_1.default(Grid_1.Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tpadding-right: 1px;\n\n\t> button {\n\t\tmargin-right: -1px;\n\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t+ button {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-top-right-radius: 3px;\n\t\t\tborder-bottom-right-radius: 3px;\n\t\t}\n\t}\n"], ["\n\tpadding-right: 1px;\n\n\t> button {\n\t\tmargin-right: -1px;\n\n\t\t&:first-child {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t}\n\n\t\t+ button {\n\t\t\tborder-radius: 0;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder-top-right-radius: 3px;\n\t\t\tborder-bottom-right-radius: 3px;\n\t\t}\n\t}\n"])));
exports.default = (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({ justify: "flex-end", align: "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(ButtonGroup, null,
                React.createElement(Button_1.default, { className: "rendition-pager__btn--prev", square: true, disabled: totalItems <= itemsPerPage || page <= 0, onClick: function () { return prevPage(); } },
                    React.createElement(fa_1.FaChevronLeft, null)),
                React.createElement(Button_1.default, { className: "rendition-pager__btn--next", square: true, disabled: totalItems <= itemsPerPage ||
                        totalItems / itemsPerPage <= page + 1, onClick: function () { return nextPage(); } },
                    React.createElement(fa_1.FaChevronRight, null))))));
});
var templateObject_1;
