import { ChangeEvent } from "react";

interface InputProps {
  type?: "text" | "password" | "email";
  placeholder?: string;
  autoFocus?: boolean;
  value?: string;
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
}

function Input({
  type = "text",
  placeholder,
  autoFocus,
  value,
  onChange,
}: InputProps) {
  return (
    <input
      type={type}
      placeholder={placeholder}
      className="bg-white border border-[#DAE0E5] w-[296px] h-10 px-2 py-2.5 rounded-lg text-sm outline-none"
      autoFocus={autoFocus}
      value={value}
      onChange={(e) => onChange && onChange(e)}
    />
  );
}

export default Input;
