Link.stories.jsx 1.5 KB

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