import React from 'react'
import { useStore } from 'store/store'

const Counter: React.FC<{
  initialValue?: number
}> = (props) => {
  //@ts-ignore

  const { increment, decrement, count: counter } = useStore()

  return (
    <div
      style={{
        display: 'flex',
      }}
    >
      <div>React counter: {counter}</div>
      <button
        onClick={() => {
          increment()
        }}
      >
        +
      </button>
      <button
        onClick={() => {
          decrement()
        }}
      >
        -
      </button>
    </div>
  )
}

export default Counter
