|
| 1 | +import type { Meta, StoryObj } from '@storybook/react-vite' |
| 2 | + |
| 3 | +import { ConnectionType, Instance } from 'uiSrc/slices/interfaces' |
| 4 | +import DatabasesListWrapper from './DatabasesListWrapper' |
| 5 | + |
| 6 | +const mockInstances: Instance[] = [ |
| 7 | + { |
| 8 | + id: 'e37cc441-a4f2-402c-8bdb-fc2413cbbaff', |
| 9 | + host: 'localhost', |
| 10 | + port: 6379, |
| 11 | + name: 'localhost', |
| 12 | + username: null, |
| 13 | + password: null, |
| 14 | + connectionType: ConnectionType.Standalone, |
| 15 | + nameFromProvider: null, |
| 16 | + new: true, |
| 17 | + modules: [], |
| 18 | + version: null, |
| 19 | + lastConnection: new Date('2021-04-22T09:03:56.917Z'), |
| 20 | + provider: 'provider', |
| 21 | + }, |
| 22 | + { |
| 23 | + id: 'a0db1bc8-a353-4c43-a856-b72f4811d2d4', |
| 24 | + host: 'localhost', |
| 25 | + port: 12000, |
| 26 | + name: 'oea123123', |
| 27 | + username: null, |
| 28 | + password: null, |
| 29 | + connectionType: ConnectionType.Standalone, |
| 30 | + nameFromProvider: null, |
| 31 | + tls: true, |
| 32 | + modules: [], |
| 33 | + version: null, |
| 34 | + }, |
| 35 | +] |
| 36 | + |
| 37 | +const meta = { |
| 38 | + component: DatabasesListWrapper, |
| 39 | +} satisfies Meta<typeof DatabasesListWrapper> |
| 40 | + |
| 41 | +export default meta |
| 42 | + |
| 43 | +type Story = StoryObj<typeof meta> |
| 44 | + |
| 45 | +export const Default: Story = { |
| 46 | + args: { |
| 47 | + instances: mockInstances, |
| 48 | + loading: false, |
| 49 | + editedInstance: null, |
| 50 | + onEditInstance: () => {}, |
| 51 | + onDeleteInstances: () => {}, |
| 52 | + onManageInstanceTags: () => {}, |
| 53 | + }, |
| 54 | +} |
| 55 | + |
| 56 | +export const Loading: Story = { |
| 57 | + args: { |
| 58 | + instances: [], |
| 59 | + loading: true, |
| 60 | + editedInstance: null, |
| 61 | + onEditInstance: () => {}, |
| 62 | + onDeleteInstances: () => {}, |
| 63 | + onManageInstanceTags: () => {}, |
| 64 | + }, |
| 65 | +} |
| 66 | + |
| 67 | +export const Empty: Story = { |
| 68 | + args: { |
| 69 | + instances: [], |
| 70 | + loading: false, |
| 71 | + editedInstance: null, |
| 72 | + onEditInstance: () => {}, |
| 73 | + onDeleteInstances: () => {}, |
| 74 | + onManageInstanceTags: () => {}, |
| 75 | + }, |
| 76 | +} |
0 commit comments