import type { Meta, StoryObj } from '@storybook/nextjs' import '@xyflow/react/dist/style.css' import type { ComponentProps, FC, PropsWithChildren } from 'react' import { ErdRendererProvider, VersionProvider } from '../../../../providers' import { mockCurrentSchema } from '../../mocks' import { ERDRenderer } from './ErdRenderer' const mockVersion = { version: '1.0.0', gitHash: 'abc123def456', envName: 'storybook', date: '2024-01-01T00:00:00Z', displayedOn: 'web' as const, } type ProvidersProps = PropsWithChildren & ComponentProps const Providers: FC = ({ children, ...props }) => { return ( {children} ) } const meta = { component: ERDRenderer, parameters: { layout: 'fullscreen', }, argTypes: { defaultSidebarOpen: { control: 'boolean', description: 'Whether the sidebar is open by default', }, withAppBar: { control: 'boolean', description: 'Whether to show the app bar', }, }, decorators: [ (Story) => (
), ], } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { args: { defaultSidebarOpen: true, withAppBar: false, }, } export const WithAppBar: Story = { args: { defaultSidebarOpen: true, withAppBar: true, }, } export const SidebarClosed: Story = { args: { defaultSidebarOpen: false, withAppBar: false, }, } export const TableNameMode: Story = { decorators: [ (Story) => (
), ], } export const KeyOnlyMode: Story = { decorators: [ (Story) => (
), ], }