loadingError.stories.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React from 'react';
  2. import {action} from '@storybook/addon-actions';
  3. import LoadingError from 'app/components/loadingError';
  4. import {Panel, PanelHeader} from 'app/components/panels';
  5. export default {
  6. title: 'UI/Loaders/LoadingError',
  7. };
  8. export const Default = () => <LoadingError onRetry={action('retry')} />;
  9. Default.storyName = 'default';
  10. Default.storyDescription = {
  11. docs: {
  12. description: {
  13. story: 'Loading error with default message',
  14. },
  15. },
  16. };
  17. export const CustomMessage = () => (
  18. <LoadingError message="Data failed to load" onRetry={action('retry')} />
  19. );
  20. CustomMessage.storyName = 'custom message';
  21. CustomMessage.parameters = {
  22. docs: {
  23. description: {
  24. story: 'Loading error with custom message',
  25. },
  26. },
  27. };
  28. export const InPanel = () => (
  29. <Panel>
  30. <PanelHeader>Header</PanelHeader>
  31. <LoadingError onRetry={action('retry')} />
  32. </Panel>
  33. );
  34. InPanel.storyName = 'in panel';
  35. InPanel.parameters = {
  36. docs: {
  37. description: {
  38. story: 'Loading error inside panel component',
  39. },
  40. },
  41. };