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

const Input = ({
  value,
  setCurrentValue,
  status,
  validateStatus,
  message,
  ...props
}) => {
  return (
    <Form.Item hasFeedback validateStatus={validateStatus} help={message}>
      <AntInput
        {...props}
        disabled={status === ElementStatus.Disabled}
        value={value}
        onChange={e => setCurrentValue(e.target.value)}
      />
    </Form.Item>
  );
};

export default Input;
