aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/forms/contact-form
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/forms/contact-form')
-rw-r--r--src/components/organisms/forms/contact-form/contact-form.stories.ts23
-rw-r--r--src/components/organisms/forms/contact-form/contact-form.stories.tsx35
2 files changed, 23 insertions, 35 deletions
diff --git a/src/components/organisms/forms/contact-form/contact-form.stories.ts b/src/components/organisms/forms/contact-form/contact-form.stories.ts
new file mode 100644
index 0000000..cd2cd1b
--- /dev/null
+++ b/src/components/organisms/forms/contact-form/contact-form.stories.ts
@@ -0,0 +1,23 @@
+import type { Meta, StoryObj } from '@storybook/react';
+import { ContactForm, type ContactFormSubmit } from './contact-form';
+
+const meta = {
+ component: ContactForm,
+ title: 'Organisms/Forms/Contact',
+} satisfies Meta<typeof ContactForm>;
+
+export default meta;
+
+type Story = StoryObj<typeof meta>;
+
+const sendMail: ContactFormSubmit = () => {
+ console.log('Mail sent!');
+
+ return undefined;
+};
+
+export const Example: Story = {
+ args: {
+ onSubmit: sendMail,
+ },
+};
diff --git a/src/components/organisms/forms/contact-form/contact-form.stories.tsx b/src/components/organisms/forms/contact-form/contact-form.stories.tsx
deleted file mode 100644
index 46111e1..0000000
--- a/src/components/organisms/forms/contact-form/contact-form.stories.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-import type { ComponentMeta, ComponentStory } from '@storybook/react';
-import { ContactForm } from './contact-form';
-
-/**
- * ContactForm - Storybook Meta
- */
-export default {
- title: 'Organisms/Forms',
- component: ContactForm,
- argTypes: {
- onSubmit: {
- control: {
- type: null,
- },
- description: 'A callback function to process the contact form data.',
- table: {
- category: 'Events',
- },
- type: {
- name: 'function',
- required: false,
- },
- },
- },
-} as ComponentMeta<typeof ContactForm>;
-
-const Template: ComponentStory<typeof ContactForm> = (args) => (
- <ContactForm {...args} />
-);
-
-/**
- * ContactForm Stories - Contact
- */
-export const Contact = Template.bind({});
-Contact.args = {};