From 1d162d7aafb3cfe2c3351b5fd891bbf6d476e9b2 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 14 Apr 2022 19:25:46 +0200
Subject: chore: add a Settings component

---
 .../organisms/toolbar/settings.stories.tsx         | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 src/components/organisms/toolbar/settings.stories.tsx

(limited to 'src/components/organisms/toolbar/settings.stories.tsx')

diff --git a/src/components/organisms/toolbar/settings.stories.tsx b/src/components/organisms/toolbar/settings.stories.tsx
new file mode 100644
index 0000000..f01e772
--- /dev/null
+++ b/src/components/organisms/toolbar/settings.stories.tsx
@@ -0,0 +1,76 @@
+import { ComponentMeta, ComponentStory } from '@storybook/react';
+import { useState } from 'react';
+import { IntlProvider } from 'react-intl';
+import SettingsComponent from './settings';
+
+export default {
+  title: 'Organisms/Toolbar',
+  component: SettingsComponent,
+  argTypes: {
+    className: {
+      control: {
+        type: 'text',
+      },
+      description: 'Set additional classnames to the modal wrapper.',
+      table: {
+        category: 'Styles',
+      },
+      type: {
+        name: 'string',
+        required: false,
+      },
+    },
+    isActive: {
+      control: {
+        type: null,
+      },
+      description: 'Define the modal state: either opened or closed.',
+      type: {
+        name: 'boolean',
+        required: true,
+      },
+    },
+    setIsActive: {
+      control: {
+        type: null,
+      },
+      description: 'A callback function to update modal state.',
+      type: {
+        name: 'function',
+        required: true,
+      },
+    },
+    tooltipClassName: {
+      control: {
+        type: 'text',
+      },
+      description: 'Set additional classnames to the tooltip wrapper.',
+      table: {
+        category: 'Styles',
+      },
+      type: {
+        name: 'string',
+        required: false,
+      },
+    },
+  },
+} as ComponentMeta<typeof SettingsComponent>;
+
+const Template: ComponentStory<typeof SettingsComponent> = ({
+  isActive,
+  setIsActive: _setIsActive,
+  ...args
+}) => {
+  const [isOpen, setIsOpen] = useState<boolean>(isActive);
+
+  return (
+    <IntlProvider locale="en">
+      <SettingsComponent isActive={isOpen} setIsActive={setIsOpen} {...args} />
+    </IntlProvider>
+  );
+};
+
+export const Settings = Template.bind({});
+Settings.args = {
+  isActive: false,
+};
-- 
cgit v1.2.3

