const CountButton = ({name, count, setCount}) => { function handleCount(event) { if (event.target.name === "backbutton") { setCount({...count, [name] :count[name] - 1}) } else if (event.target.name === "forwardbutton") { setCount({...count, [name] :count[name] + 1}) } else { setCount({...count, [name] :event.target.value}) } } return ( <> ) } export default CountButton