import React, { useState } from "react";
import { storiesOf } from "@storybook/react";
import Story from "../../storybook-components/Story";
import { Pagination } from "./Pagination";

const stories = storiesOf("Deprecated/Pagination", module);

stories.add("Default", () => {
  const [page, setPage] = useState(1);

  const handlePageChange = (newPage: number) => {
    setPage(newPage);
  };

  return (
    <Story title="Pagination">
      <Pagination
        currentPageNumber={page}
        itemsPerPage={14}
        totalItems={144}
        onPageChange={handlePageChange}
      />
    </Story>
  );
});
