import { MemoryRouter as Router, Switch, Route } from 'react-router-dom';
import { IpcRenderer } from 'electron/renderer';

import './App.css';

const ipcRenderer = (window as any).electron.ipcRenderer as IpcRenderer;

function tap() {
  ipcRenderer.send("beat-tracking", "tap");
}

const Hello = () => {

  return (
    <div>
      <button onClick={tap}>Tap</button>
    </div>
  );
};

export default function App() {
  return (
    <Router>
      <Switch>
        <Route path="/" component={Hello} />
      </Switch>
    </Router>
  );
}
