"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.TabTotalCounterBadge = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _mobxReactLite = require("mobx-react-lite");
var _designSystem = require("@wix/design-system");
var _react = _interopRequireDefault(require("react"));
var _useFilterValueTotalState = require("./useFilterValueTotalState");
var _initTabTotal = require("../../state/initTabTotal");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/TabTotal/TabTotalCounterBadge.tsx";
function _TabCounterBadge(props) {
  const {
    value,
    skin = 'neutralStandard',
    ...rest
  } = props;
  const state = (0, _useFilterValueTotalState.useFilterValueTotalState)(props);
  const {
    totalsCollection: {
      totalStatus,
      total,
      lifecycleState
    }
  } = state;
  return totalStatus === 'success' && lifecycleState === 'result' ? /*#__PURE__*/_react.default.createElement(_designSystem.CounterBadge, (0, _extends2.default)({
    skin: skin
  }, rest, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 26,
      columnNumber: 5
    }
  }), total) : null;
}
_TabCounterBadge.initTabTotal = _initTabTotal.initTabTotal;
const TabTotalCounterBadge = exports.TabTotalCounterBadge = (0, _mobxReactLite.observer)(_TabCounterBadge);
TabTotalCounterBadge.displayName = 'TabTotalCounterBadge';
TabTotalCounterBadge.initTabTotal = _initTabTotal.initTabTotal;
//# sourceMappingURL=TabTotalCounterBadge.js.map