"use strict";

exports.__esModule = true;
exports.LinearAbsoluteProgressBar = LinearAbsoluteProgressBar;
var _designSystem = require("@wix/design-system");
var _react = _interopRequireWildcard(require("react"));
var _Heading = require("../Heading");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/ExportButton/LinearAbsoluteProgressBar.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function LinearAbsoluteProgressBar(props) {
  const {
    dataHook,
    value,
    count,
    total
  } = props;
  const [formatter] = (0, _react.useState)(() => Intl.NumberFormat('en', {
    notation: 'compact'
  }));
  const countFormatted = (0, _react.useMemo)(() => formatter.format(count), [count]);
  const totalFormatted = (0, _react.useMemo)(() => total != null ? formatter.format(total) : null, [total]);
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    verticalAlign: "middle",
    dataHook: dataHook,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.LinearProgressBar, {
    value: value,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    width: total != null ? '54px' : '24px',
    minWidth: 0,
    flexShrink: 0,
    align: "right",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_Heading.Heading, {
    size: "extraTiny",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 9
    }
  }, /*#__PURE__*/_react.default.createElement("span", {
    "data-hook": "progress-count",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 39,
      columnNumber: 11
    }
  }, countFormatted), totalFormatted != null && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 42,
      columnNumber: 15
    }
  }, "/"), /*#__PURE__*/_react.default.createElement("span", {
    "data-hook": "progress-total",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 43,
      columnNumber: 15
    }
  }, totalFormatted)))));
}
//# sourceMappingURL=LinearAbsoluteProgressBar.js.map