Link.stories.jsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import React from 'react';
  2. import {Link} from './Link';
  3. import {QueueRow} from "./QueueRow";
  4. // More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
  5. export default {
  6. component: Link,
  7. title:'Example/Link',
  8. // More on argTypes: https://storybook.js.org/docs/react/api/argtypes
  9. argTypes: {
  10. backgroundColor: {control: 'color'},
  11. },
  12. };
  13. // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
  14. // const Template = (args) => <table><QueueRow {...args} /></table>;
  15. const Template = (args) => <div className="bg-gray-200 px-4 border-solid border-2 border-pink-600"><Link {...args} /></div>;
  16. export const Undefined = Template.bind({});
  17. Undefined.args = {
  18. text: undefined,
  19. url: undefined,
  20. };
  21. export const EmptyText = Template.bind({});
  22. EmptyText.args = {
  23. text: '',
  24. url: 'https://sqs.eu-west-3.amazonaws.com/1234567890/main-queue',
  25. };
  26. export const NullText = Template.bind({});
  27. NullText.args = {
  28. text: null,
  29. url: 'https://sqs.eu-west-3.amazonaws.com/1234567890/main-queue',
  30. };
  31. export const UndefinedText = Template.bind({});
  32. UndefinedText.args = {
  33. text: undefined,
  34. url: 'https://sqs.eu-west-3.amazonaws.com/1234567890/main-queue',
  35. };
  36. export const NullURL = Template.bind({});
  37. NullURL.args = {
  38. text: "some text, but no URL",
  39. url: null,
  40. };
  41. export const Normal = Template.bind({});
  42. Normal.args = {
  43. text: 'some text',
  44. url: 'https://sqs.eu-west-3.amazonaws.com/1234567890/main-queue',
  45. };