aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/toolbar/search.stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/organisms/toolbar/search.stories.tsx')
-rw-r--r--src/components/organisms/toolbar/search.stories.tsx16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/components/organisms/toolbar/search.stories.tsx b/src/components/organisms/toolbar/search.stories.tsx
index 2c8dd10..0f211bd 100644
--- a/src/components/organisms/toolbar/search.stories.tsx
+++ b/src/components/organisms/toolbar/search.stories.tsx
@@ -1,5 +1,5 @@
-import { ComponentMeta, ComponentStory } from '@storybook/react';
-import { useState } from 'react';
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import { useToggle } from '../../../utils/hooks';
import { Search } from './search';
/**
@@ -66,17 +66,9 @@ const Template: ComponentStory<typeof Search> = ({
setIsActive: _setIsActive,
...args
}) => {
- const [isOpen, setIsOpen] = useState<boolean>(isActive);
+ const [isOpen, toggle] = useToggle(isActive);
- return (
- <Search
- isActive={isOpen}
- setIsActive={() => {
- setIsOpen(!isOpen);
- }}
- {...args}
- />
- );
+ return <Search isActive={isOpen} setIsActive={toggle} {...args} />;
};
/**