overleaf/services/web/frontend/stories/loading/loading-error.stories.tsx
Alf Eaton 1e1a8c0bb3 Add translated messages for more connection error states (#19392)
GitOrigin-RevId: 981de624f3964ebe3ff1f0c751fcef9158864d5e
2024-07-15 09:32:55 +00:00

33 lines
827 B
TypeScript

import type { Meta, StoryObj } from '@storybook/react'
import { LoadingError } from '@/features/ide-react/components/loading-error'
const meta: Meta<typeof LoadingError> = {
title: 'Loading Page / Loading Error',
component: LoadingError,
}
export default meta
type Story = StoryObj<typeof LoadingError>
export const IoNotLoaded: Story = {
render: () => {
window.metaAttributesCache.set(
'ol-translationIoNotLoaded',
'Could not connect to the WebSocket server'
)
return <LoadingError connectionStateError="io-not-loaded" />
},
}
export const UnableToJoin: Story = {
render: () => {
window.metaAttributesCache.set(
'ol-translationUnableToJoin',
'Could not connect to the collaboration server'
)
return <LoadingError connectionStateError="unable-to-join" />
},
}