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

import {InputTextArea} from './index';

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

type Story = StoryObj<typeof InputTextArea>;

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

export default meta;
