import React from 'react';
interface InputProps {
value: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
placeholder?: string;
className?: string;
type?: string;
onKeyPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
disabled?: boolean;
}
const Input: React.FC<InputProps> = ({
value,
onChange,
placeholder = '',
className = '',
type = 'text',
onKeyPress,
onKeyDown,
disabled = false
}) => {
return (
<input
type={type}
value={value}
onChange={onChange}
onKeyPress={onKeyPress}
onKeyDown={onKeyDown}
placeholder={placeholder}
disabled={disabled}
className={`w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed ${className}`}
/>
);
};
export default Input;