import React, { useState } from "react"
import { withRouter } from "react-router-dom"

const TSTest: React.FC = () => {
  const [count, setCount] = useState(0)

  function handleAlertClick() {
    setTimeout(() => {
      alert("You clicked on: " + count)
    }, 3000)
  }

  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>Click me</button>
      <button onClick={handleAlertClick}>Show alert</button>
    </div>
  )
}

function C(a = 2, b = 3, c = 4, d = 5, e = 6) {
  return d
}

export default withRouter(TSTest)
