TableRows.stories.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import React from 'react';
  2. import {QueueRow} from './QueueRow';
  3. import {TableRows} from "./TableRows";
  4. import {Empty, Queried, Unqueried, UnqueriedNoURL} from './QueueRow.stories';
  5. // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
  6. export default {
  7. component: TableRows,
  8. title: 'Example/TableRows',
  9. // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
  10. argTypes: {
  11. backgroundColor: {control: 'color'},
  12. },
  13. };
  14. // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
  15. const Template = (args) => <TableRows {...args} />;
  16. var allRows = {
  17. Empty,
  18. Unqueried,
  19. UnqueriedNoURL,
  20. Queried,
  21. };
  22. export var rows = Object.keys(allRows).map((rowKey, index) => {
  23. const rowArgs = allRows[rowKey].args
  24. return <QueueRow key={index}
  25. arn={rowArgs.arn}
  26. itemCount={rowArgs.itemCount}
  27. qName={rowArgs.qName}
  28. url={rowArgs.url}
  29. >{index}</QueueRow>
  30. });
  31. export const AllRowsKinds = Template.bind({});
  32. AllRowsKinds.args = {rows};