diff options
Diffstat (limited to 'src/components/organisms/forms/comment-form')
| -rw-r--r-- | src/components/organisms/forms/comment-form/comment-form.stories.ts | 23 | ||||
| -rw-r--r-- | src/components/organisms/forms/comment-form/comment-form.stories.tsx | 44 |
2 files changed, 23 insertions, 44 deletions
diff --git a/src/components/organisms/forms/comment-form/comment-form.stories.ts b/src/components/organisms/forms/comment-form/comment-form.stories.ts new file mode 100644 index 0000000..0518f61 --- /dev/null +++ b/src/components/organisms/forms/comment-form/comment-form.stories.ts @@ -0,0 +1,23 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { CommentForm, type CommentFormSubmit } from './comment-form'; + +const meta = { + component: CommentForm, + title: 'Organisms/Forms/Comment', +} satisfies Meta<typeof CommentForm>; + +export default meta; + +type Story = StoryObj<typeof meta>; + +const saveComment: CommentFormSubmit = () => { + console.log('Comment saved!'); + + return undefined; +}; + +export const Example: Story = { + args: { + onSubmit: saveComment, + }, +}; diff --git a/src/components/organisms/forms/comment-form/comment-form.stories.tsx b/src/components/organisms/forms/comment-form/comment-form.stories.tsx deleted file mode 100644 index fcc76fa..0000000 --- a/src/components/organisms/forms/comment-form/comment-form.stories.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import type { ComponentMeta, ComponentStory } from '@storybook/react'; -import { CommentForm as CommentFormComponent } from './comment-form'; - -/** - * CommentForm - Storybook Meta - */ -export default { - title: 'Organisms/Forms', - component: CommentFormComponent, - argTypes: { - parentId: { - control: { - type: null, - }, - description: 'The parent id if it is a reply.', - type: { - name: 'number', - required: false, - }, - }, - onSubmit: { - control: { - type: null, - }, - description: 'A callback function to process the comment form data.', - table: { - category: 'Events', - }, - type: { - name: 'function', - required: false, - }, - }, - }, -} as ComponentMeta<typeof CommentFormComponent>; - -const Template: ComponentStory<typeof CommentFormComponent> = (args) => ( - <CommentFormComponent {...args} /> -); - -/** - * Forms Stories - Comment form - */ -export const CommentForm = Template.bind({}); |
