import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; import { getWrapperDecorator } from '../../stories'; import { Toolbar } from '.'; // Toolbar is a plain .jsx component with defaultProps instead of inline // destructuring defaults, so TS can't infer its props as optional on its own. const TypedToolbar = Toolbar as unknown as React.ComponentType<{ className?: string; children: React.ReactNode; renderActions?: (params: { actionClassName: string }) => React.ReactNode; }>; const meta = { title: 'UI/Toolbar', component: TypedToolbar, decorators: [getWrapperDecorator()], } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = { args: { children:
Content
, }, }; export const WithActions: Story = { args: { children: 'Content', renderActions: ({ actionClassName }) => ( <>
Action 1
Action 2
), }, };