'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var PropTypes = require('prop-types');
var React = require('react');
var classnames = require('classnames');
var usePrefix = require('../../internal/usePrefix.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
var React__default = /*#__PURE__*/_interopDefault(React);
var classnames__default = /*#__PURE__*/_interopDefault(classnames);

/**
 * Copyright IBM Corp. 2016, 2023
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */


const BadgeIndicator = /*#__PURE__*/React__default.default.forwardRef(function BadgeIndicatorContent({
  className: customClassName,
  count,
  ...rest
}, ref) {
  const prefix = usePrefix.usePrefix();
  const classNames = classnames__default.default(`${prefix}--badge-indicator`, customClassName, {
    [`${prefix}--badge-indicator--count`]: count
  });
  const displayCount = count && count > 999 ? '999+' : count;
  return /*#__PURE__*/React__default.default.createElement("div", _rollupPluginBabelHelpers.extends({
    className: classNames,
    ref: ref
  }, rest), displayCount);
});
BadgeIndicator.propTypes = {
  /**
   * Specify an optional className to add.
   */
  className: PropTypes__default.default.string,
  /**
   * Count of badge indicator
   */
  count: PropTypes__default.default.number,
  /**
   * Provide an `id` to uniquely identify the BadgeIndidcator
   */
  id: PropTypes__default.default.string
};

exports.BadgeIndicator = BadgeIndicator;
exports.default = BadgeIndicator;
