import React, {useEffect, useState} from 'react';
import { EVENT_NAMES } from "./../../enums/enums"
import "./style.scss"
import Throttle from "./../../assets/icons/throttle.svg"

const ThrottleStable = (props) => {
    const [throttle, setThrottle] = useState(0);

    useEffect(
        () => {
          window.electron.receive(EVENT_NAMES.TELEMETRY_THROTTLE, (data) => {
            setThrottle(rpm.value);
          })
          return () => {
          };
        },[]
      );
    return (
        <div className="throttle-stable">
            <div className="throttle-stable__container">
                <img className="throttle-stable__icon" src={Throttle} />
                <div style={{height: throttle}} className="throttle-stable__throttle"></div>
            </div>
            
        </div>
    );
}

export default ThrottleStable;