detailedError.stories.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import {action} from '@storybook/addon-actions';
  2. import DetailedError from 'sentry/components/errors/detailedError';
  3. export default {
  4. title: 'Views/Detailed Error',
  5. component: DetailedError,
  6. };
  7. export const Default = () => (
  8. <DetailedError heading="Error heading" message="Error message" />
  9. );
  10. Default.storyName = 'Default';
  11. Default.parameters = {
  12. docs: {
  13. description: {
  14. story: 'Displays a detailed error message',
  15. },
  16. },
  17. };
  18. export const WithRetry = () => (
  19. <DetailedError
  20. onRetry={action('onRetry')}
  21. heading="Error heading"
  22. message="Error message"
  23. />
  24. );
  25. WithRetry.storyName = 'With Retry';
  26. WithRetry.parameters = {
  27. docs: {
  28. description: {
  29. story: 'If `onRetry` callback is supplied, will show a "Retry" button in footer',
  30. },
  31. },
  32. };
  33. export const HidesSupportLinks = () => (
  34. <DetailedError
  35. onRetry={action('onRetry')}
  36. hideSupportLinks
  37. heading="Error heading"
  38. message="Error message"
  39. />
  40. );
  41. HidesSupportLinks.storyName = 'Hides Support Links';
  42. HidesSupportLinks.parameters = {
  43. docs: {
  44. description: {
  45. story: 'Hides support links',
  46. },
  47. },
  48. };
  49. export const HidesFooter = () => (
  50. <DetailedError hideSupportLinks heading="Error heading" message="Error message" />
  51. );
  52. HidesFooter.storyName = 'Hides Footer';
  53. HidesFooter.parameters = {
  54. docs: {
  55. description: {
  56. story: 'Hides footer if no support links or retry',
  57. },
  58. },
  59. };