import { Form, Input as AntInput } from 'antd';
import { ElementStatus } from 'types/elements';

const TextArea = ({
  value,
  setCurrentValue,
  status,
  validateStatus,
  message,
  ...props
}) => {
  return (
    <Form.Item validateStatus={validateStatus} help={message}>
      <AntInput.TextArea
        {...props}
        autoSize={{ minRows: 5, maxRows: 8 }}
        disabled={status === ElementStatus.Disabled}
        value={value}
        onChange={e => setCurrentValue(e.target.value)}
      />
    </Form.Item>
  );
};

export default TextArea;
