import {useState} from 'react' const CountButton = ({count, setCount}) => { const name = name 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 (