loadingError.stories.js 1.0 KB

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