pagination.stories.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import Pagination from 'sentry/components/pagination';
  2. export default {
  3. title: 'Components/Buttons/Pagination',
  4. component: Pagination,
  5. };
  6. const withBoth = `<https://sentry.io/api/0/organizations/sentry/issues/?cursor=1603798246000:0:1>; rel="previous"; results="true"; cursor="1603798246000:0:1",
  7. <https://sentry.io/api/0/organizations/sentry/issues/?cursor=1603719405000:0:0>; rel="next"; results="true"; cursor="1603719405000:0:0"
  8. `;
  9. const withNext = `<https://sentry.io/api/0/organizations/sentry/issues/?cursor=1603798246000:0:1>; rel="previous"; results="false"; cursor="1603798246000:0:1",
  10. <https://sentry.io/api/0/organizations/sentry/issues/?cursor=1603719405000:0:0>; rel="next"; results="true"; cursor="1603719405000:0:0"
  11. `;
  12. export const Default = () => {
  13. return (
  14. <div>
  15. <div className="section">
  16. <h3>Both enabled</h3>
  17. <Pagination location={window.location} pageLinks={withBoth} />
  18. </div>
  19. <div className="section">
  20. <h3>Only next enabled</h3>
  21. <Pagination location={window.location} pageLinks={withNext} />
  22. </div>
  23. </div>
  24. );
  25. };
  26. Default.storyName = 'Pagination';