import React, { useState } from "react";
import Axios from "axios";

const DevStatus = () => {
  const [startDevBtn, setStart_dev_Bt] = useState(true);


  const onStartDev = () => {
    Axios({
      method: "GET",
      withCredentials: true,
      url: process.env.REACT_APP_BACKEND_URL + "/Device/start",
    }).then(async (res) => {
      console.log("********************");
      // update dataset name

    });

    setStart_dev_Bt(false);
  };




  return (
    <React.Fragment>
      <div className=" row  m-1 ">
        <div className="col-12 px-1  my-1">
          <button
            disabled={!startDevBtn}
            className="btn btn-primary btn-block"
            onClick={onStartDev}
          >
            Start Dev 
          </button>
        </div>
        </div>
        
    </React.Fragment>
  );
};
export default DevStatus;
