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

import {InputRichTextArea} from './index';

const meta: Meta<typeof InputRichTextArea> = {
  title: 'HuGo/Inputs/InputRichTextArea',
  component: InputRichTextArea,
  argTypes: {
    label: {type: 'string'},
    placeholder: {type: 'string'},
    helper: {type: 'string'},
    disabled: {type: 'boolean'},
    isError: {type: 'boolean'},
    isSuccess: {type: 'boolean'},
    showCounter: {type: 'boolean'},
  },
};

type Story = StoryObj<typeof InputRichTextArea>;

export const InputRichTextAreaComponent: Story = {
  args: {
    label: 'Label',
    placeholder: 'Placeholder',
    helper: 'Helper',
    disabled: false,
    isError: false,
    isSuccess: false,
    showCounter: false,
  },
  render: args => {
    const [value, setValue] = useState('');
    return (
      <InputRichTextArea {...args} value={value} onChangeText={setValue} />
    );
  },
};

export default meta;
