/* eslint-disable react-hooks/rules-of-hooks */
import React, {useState} from 'react';
import {Meta, StoryObj} from '@storybook/react';

import {Toggle} from './index';

const meta: Meta<typeof Toggle> = {
  title: 'HuGo/Toggle',
  component: Toggle,
  argTypes: {
    disabled: {control: 'boolean'},
  },
};

type Story = StoryObj<typeof Toggle>;

export const ToggleComponent: Story = {
  render: args => {
    const [value, setValue] = useState(false);

    return <Toggle {...args} value={value} onToggle={setValue} />;
  },
};

export default meta;
