loading-error.stories.tsx 827 B

123456789101112131415161718192021222324252627282930313233
  1. import type { Meta, StoryObj } from '@storybook/react'
  2. import { LoadingError } from '@/features/ide-react/components/loading-error'
  3. const meta: Meta<typeof LoadingError> = {
  4. title: 'Loading Page / Loading Error',
  5. component: LoadingError,
  6. }
  7. export default meta
  8. type Story = StoryObj<typeof LoadingError>
  9. export const IoNotLoaded: Story = {
  10. render: () => {
  11. window.metaAttributesCache.set(
  12. 'ol-translationIoNotLoaded',
  13. 'Could not connect to the WebSocket server'
  14. )
  15. return <LoadingError connectionStateError="io-not-loaded" />
  16. },
  17. }
  18. export const UnableToJoin: Story = {
  19. render: () => {
  20. window.metaAttributesCache.set(
  21. 'ol-translationUnableToJoin',
  22. 'Could not connect to the collaboration server'
  23. )
  24. return <LoadingError connectionStateError="unable-to-join" />
  25. },
  26. }