aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/navbar/navbar-item/navbar-item.stories.tsx
blob: 1c5676898e83ad4a494c21bc441b41d3f94bafe0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import type { ComponentMeta, ComponentStory } from '@storybook/react';
import { useBoolean } from '../../../../utils/hooks';
import { NavbarItem } from './navbar-item';

/**
 * NavbarItem - Storybook Meta
 */
export default {
  title: 'Organisms/Navbar/Item',
  component: NavbarItem,
  argTypes: {},
} as ComponentMeta<typeof NavbarItem>;

const Template: ComponentStory<typeof NavbarItem> = ({
  isActive,
  onDeactivate,
  onToggle,
  ...args
}) => {
  const { deactivate, state, toggle } = useBoolean(isActive);

  return (
    <NavbarItem
      {...args}
      isActive={state}
      onDeactivate={deactivate}
      onToggle={toggle}
    />
  );
};

/**
 * NavbarItem Stories - Default
 */
export const Default = Template.bind({});
Default.args = {
  children: 'The modal contents.',
  icon: 'cog',
  id: 'default',
  isActive: false,
  label: 'Open example',
};

/**
 * NavbarItem Stories - ModalVisibleAfterBreakpoint
 */
export const ModalVisibleAfterBreakpoint = Template.bind({});
ModalVisibleAfterBreakpoint.args = {
  children: 'The modal contents.',
  icon: 'cog',
  id: 'modal-visible',
  isActive: false,
  label: 'Open example',
  modalVisibleFrom: 'md',
};