import { useState } from 'react';

export const RangeInput = ({ min, max }) => {
  const [inputText, setInputText] = useState('');

  const handleInputChange = (event) => {
    setInputText(event.target.value);
  };

  const inputStyle =
    inputText.length < min || inputText.length > max ? { border: '1px solid red' } : {};

  return <input type="text" value={inputText} onChange={handleInputChange} style={inputStyle} />;
};
