import cn from '../utils/cn';

const Input = ({ type = 'text', value, className, onChange, placeholder = 'Placeholder', min, id, onFocus }) => {
  return (
    <input
      onFocus={onFocus}
      id={id}
      {...(type === 'number' && typeof min === 'number' && { min })}
      value={value}
      onChange={onChange}
      className={cn(
        '!wmx-rounded-md !wmx-border wmx-leading-normal placeholder:wmx-text-gray-400 wmx-text-[15px] !wmx-border-gray-300 !wmx-bg-white !wmx-py-0.5 !wmx-shadow-none focus:!wmx-outline-none focus:!wmx-border-primary',
        className
      )}
      type={type}
      placeholder={placeholder}
    />
  );
};
export default Input;
