| 1 |
import PropTypes from 'prop-types'; |
| 2 |
import classNames from 'classnames'; |
| 3 |
import styles from './style.module.scss'; |
| 4 |
|
| 5 |
const Input = ({type, name, onChange, value, className, ...rest}) => { |
| 6 |
return ( |
| 7 |
<input |
| 8 |
key={value} |
| 9 |
className={classNames(styles.input, className)} |
| 10 |
type={type} |
| 11 |
name={name} |
| 12 |
onChange={onChange} |
| 13 |
value={value} |
| 14 |
{...rest} |
| 15 |
/> |
| 16 |
); |
| 17 |
}; |
| 18 |
|
| 19 |
Input.propTypes = { |
| 20 |
// Input type |
| 21 |
type: PropTypes.string.isRequired, |
| 22 |
// On change event |
| 23 |
onChange: PropTypes.func, |
| 24 |
// Input value |
| 25 |
value: PropTypes.string, |
| 26 |
}; |
| 27 |
|
| 28 |
export default Input; |
| 29 |
|