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

import {Switch} from './index';

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

type Story = StoryObj<typeof Switch>;

export const SwitchComponent: Story = {
  args: {
    title: 'Title',
    description: 'Description',
    disabled: false,
  },
  render: args => {
    const [value, setValue] = useState(false);

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

export default meta;
