import React from 'react' import styles from './styles.module.css' export default function Input({label, minimum = 0, maximum, error, hint, name, value, onChange, onBlur, isValid}){ const current = parseInt(value, 10) || 0 const nextUp = maximum !== undefined ? Math.min(current + 1, maximum) : current + 1 const nextDown = minimum !== undefined ? Math.max(current - 1, minimum) : current - 1 const valueUp = ()=>onChange({target: {value: nextUp + ""}}) const valueDown = ()=>onChange({target: {value: nextDown + ""}}) return (
{error || (isValid ? '' : hint)}
) }