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

import {InputPhone} from './index';

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

type Story = StoryObj<typeof InputPhone>;

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

export const SmallInputPhone: Story = {
  args: {
    ...InputPhoneComponent.args,
    size: 'sm',
  },
  render: InputPhoneComponent.render,
};

export default meta;
