import {ChangeEvent, FC} from "react";

interface InputProps {
 type: 'text' | 'number' | 'email' | 'password';
 label: string;
 value: string|number;
 placeholder: string;
 error: boolean;
 name: string;
 disabled?: boolean;
 onChange: (e: ChangeEvent<HTMLInputElement>) => void;
}

const Input: FC<InputProps> = ({label, type, placeholder, name, disabled, onChange, value}) => {
  return <>
    <div className="mb-2">
      <label htmlFor={label} className={"block"}>
        {label}:
      </label>
      <input className={"block w-full border border-gray-500 rounded-lg p-2 lg:w-full text-black"}
             type={type}
             placeholder={placeholder}
             name={name}
             disabled={disabled}
             onChange={onChange}
             value={value}/>
    </div>


  </>
}

export default Input;