"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = CategoryItem;
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * Internal dependencies
 */

function CategoryItem({
  count,
  icon,
  id,
  isActive,
  label,
  type
}) {
  if (!count) {
    return;
  }
  const queryArgs = [`postType=${type}`];
  if (id) {
    queryArgs.push(`categoryId=${id}`);
  }
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
    icon: icon,
    suffix: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
      children: count
    }),
    "aria-current": isActive ? 'true' : undefined,
    to: `/pattern?${queryArgs.join('&')}`,
    children: label
  });
}
//# sourceMappingURL=category-item.js.map