import { useState } from 'preact/hooks'

export const Counter = ({}) => {
    const [count, setCount] = useState(0)

    return (
        <div class="counter">
            <button onClick={() => setCount(value => value - 1)}>-</button>
            <div class="value">{count}</div>
            <button onClick={() => setCount(value => value + 1)}>+</button>
        </div>
    )
}
