{"size": 812, "ext": "js", "max_stars_repo_path": "src/Sidebar/AddWatchedDataButton.js", "max_stars_repo_name": "cooperia/ReactStateManagementExample", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Sidebar/AddWatchedDataButton.js", "max_issues_repo_name": "cooperia/ReactStateManagementExample", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/Sidebar/AddWatchedDataButton.js", "max_forks_repo_name": "cooperia/ReactStateManagementExample", "max_forks_repo_forks_event_min_datetime": "2020-09-14T17:19:46.000Z", "max_forks_repo_forks_event_max_datetime": "2020-09-14T17:19:46.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 20.8205128205, "max_line_length": 55, "alphanum_fraction": 0.5}
import React from 'react'
import '../App.css'
import { useContext} from 'use-context-selector'
import { DispatchContext} from '../State/State'

const AddWatchedDataButton = () => {
  console.log("AddWatchedDataButton is being rendered")
  const dispatch = useContext(DispatchContext)

  return (
    <>
      <button onClick={() => {
        dispatch({
          type: 'ADD_DATA', 
          data: {
            ViewType: "A",
            Text: "View Type A"
          }
        })
      }}>
        Add View Type A
      </button>
      <button onClick={() => {
        dispatch({
          type: 'ADD_DATA', 
          data: {
            ViewType: "B",
            Text: "View Type B"
          }
        })
      }}>
        Add View Type B
      </button>
    </>
  )
}

export default AddWatchedDataButton
