import React, { memo, useEffect, useState } from "react";
import { EventEmitter } from "../../services";
import "./style.css";

var ProgressBarUpload = function ProgressBarUpload() {
  var _useState = useState(0),
      uploadProgress = _useState[0],
      setUploadProgress = _useState[1];

  useEffect(function () {
    EventEmitter.on("UPLOAD_PROGRESS", function (percent) {
      setUploadProgress(percent);
    });
    return function cleanup() {
      EventEmitter.off("UPLOAD_PROGRESS");
    };
  }, []);
  return /*#__PURE__*/React.createElement("div", {
    className: "progress-container"
  }, /*#__PURE__*/React.createElement("p", null, "Uploading video... "), /*#__PURE__*/React.createElement("div", {
    className: "progress progress-moved"
  }, /*#__PURE__*/React.createElement("div", {
    className: "progress-bar-upload",
    style: {
      width: uploadProgress + "%"
    }
  })));
};

export default memo(ProgressBarUpload);