import "choerodon-ui/lib/tooltip/style";
import _Tooltip from "choerodon-ui/lib/tooltip";
import React from 'react';
import { FormattedMessage } from 'react-intl';
import _ from 'lodash';
import "../index.less";
export default function MaxTagPopover(props) {
  var value = props.value,
      dataSource = props.dataSource,
      width = props.width,
      placement = props.placement;
  var moreOption = [];

  _.forEach(value, function (item, index) {
    var appName = _.find(dataSource, ['id', item]);

    appName && moreOption.push( /*#__PURE__*/React.createElement("span", {
      key: item
    }, appName.name, index < value.length - 1 ? '，' : ''));
  });

  return /*#__PURE__*/React.createElement(_Tooltip, {
    arrowPointAtCenter: true,
    placement: placement,
    overlayClassName: "c7n-report-maxPlace",
    title: moreOption
  }, /*#__PURE__*/React.createElement("div", {
    className: "c7n-report-maxPlace-inner",
    title: ""
  }, /*#__PURE__*/React.createElement(FormattedMessage, {
    id: "dashboard.devops.more"
  })));
}
/* eslint-disable-next-line */

MaxTagPopover.defaultProps = {
  placement: 'bottomLeft',
  width: 350
};