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