import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { ElementName, IconType } from '../../../../../constants';
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
import { BaseBadgeElement, toBadgeProps } from '../common';
var ViewCountElement = function ViewCountElement(props) {
  var _context$viewCount;
  var context = useFlexibleUiContext();
  var data = context ? toBadgeProps((_context$viewCount = context.viewCount) === null || _context$viewCount === void 0 ? void 0 : _context$viewCount.toString()) : null;
  return data ? /*#__PURE__*/React.createElement(BaseBadgeElement, _extends({
    icon: IconType.View
  }, data, props, {
    name: ElementName.ViewCount
  })) : null;
};
export default ViewCountElement;