import React from 'react';
import { Form, Input } from 'antd';
import type { RuleObject } from 'rc-field-form/lib/interface';
type RuleConfig = RuleObject

interface InputTextProps {
    name: string
    label: string
    disabled?: boolean
    rules?: RuleConfig[] | undefined
    [key: string]: unknown
}

const InputText: React.FC<InputTextProps> = ({
  name,
  label,
  disabled = false,
  rules = [],
  ...rest
}) => {
  return (
    <Form.Item label={label} name={name} rules={rules} {...rest}>
      <Input disabled={disabled} {...rest} />
    </Form.Item>
  );
};

export default InputText;
