import './Counter.sass'
import { createSignal } from 'solid-js'

let [count, setCount] = createSignal(0)

const increment = () => {
  setCount(count() + 1)
}

const decrement = () => {
  setCount(count() - 1)
}

export default () => {
  return (
    <>
      <section class="counter">
        <div class="counter__display">{count()}</div>
        <div class="counter__buttons">
          <button class="counter__decrement" onClick={decrement}>
            -
          </button>
          <button class="counter__increment" onClick={increment}>
            +
          </button>
        </div>
      </section>
    </>
  )
}
