"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var react_1 = require("@storybook/react");
var storybook_chrome_screenshot_1 = require("storybook-chrome-screenshot");
var with_readme_1 = require("storybook-readme/with-readme");
var _1 = require("../");
var Readme = require("./README/Pager.md");
var PagerHOC = (function (_super) {
    __extends(PagerHOC, _super);
    function PagerHOC() {
        var _this = _super.call(this) || this;
        _this.state = {
            page: 0
        };
        return _this;
    }
    PagerHOC.prototype.render = function () {
        var _this = this;
        var page = this.state.page;
        return (React.createElement(_1.Box, { m: 3 },
            React.createElement(_1.Pager, { totalItems: 436, itemsPerPage: 50, page: page, nextPage: function () { return _this.setState({ page: page + 1 }); }, prevPage: function () { return _this.setState({ page: page - 1 }); } })));
    };
    return PagerHOC;
}(React.Component));
react_1.storiesOf('Core/Pager', module)
    .addDecorator(with_readme_1.default(Readme))
    .addDecorator(storybook_chrome_screenshot_1.withScreenshot())
    .add('Standard', function () {
    return (React.createElement(_1.Provider, null,
        React.createElement(PagerHOC, null)));
});
