import React from 'react';
import './controls.css'
import { sendMsg } from '../api';

class Controls extends React.Component
{
  constructor(props) {
    super(props);
    this.ws = props.ws;

    // This binding is necessary to make `this` work in the callback
  }
  getMessage()
  {
    var msg = 
    {
      Type: "Request",
      Data: "COP"

    }
    sendMsg(JSON.stringify(msg));
    console.log("test");

  }
    render() {
        return (
          <div className="controls">
            <button onClick={this.getMessage}> click me!</button>
          </div>
        );
      }

}

export default Controls;
