import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
var _excluded = ["number", "text", "isActive"];
import React, { useState } from 'react';
import { addStoryInGroup, MID_LEVEL_BLOCKS } from '../../../.storybook/utils';
import { Pagination, Button } from '../../index';
export default {
  component: Pagination,
  title: addStoryInGroup(MID_LEVEL_BLOCKS, 'Pagination')
};
export var DefaultStory = function DefaultStory(args) {
  var _useState = useState(1),
      _useState2 = _slicedToArray(_useState, 2),
      page = _useState2[0],
      setPage = _useState2[1];

  return /*#__PURE__*/React.createElement(Pagination, _extends({}, args, {
    numPages: 21,
    currentPage: page
  }), function (_ref) {
    var number = _ref.number,
        text = _ref.text,
        isActive = _ref.isActive,
        others = _objectWithoutProperties(_ref, _excluded);

    return /*#__PURE__*/React.createElement(Button, _extends({
      level: "link",
      label: text,
      disabled: isActive,
      size: "small"
    }, others, {
      onClick: function onClick() {
        return setPage(number);
      }
    }));
  });
};
DefaultStory.args = {
  currentPage: 3,
  numPages: 21
};