import "choerodon-ui/lib/icon/style";
import _Icon from "choerodon-ui/lib/icon";
import React, { memo } from 'react';
import "./index.less";
var IssueType = /*#__PURE__*/memo(function (_ref) {
  var data = _ref.data,
      showName = _ref.showName,
      style = _ref.style,
      featureType = _ref.featureType,
      _ref$iconSize = _ref.iconSize,
      iconSize = _ref$iconSize === void 0 ? 24 : _ref$iconSize;

  var _ref2 = data || {},
      colour = _ref2.colour,
      _ref2$name = _ref2.name,
      name = _ref2$name === void 0 ? '' : _ref2$name,
      icon = _ref2.icon;

  if (featureType === 'business') {
    colour = '#3D5AFE';
    name = '特性';
    icon = 'characteristic';
  } else if (featureType === 'enabler') {
    colour = '#FFCA28';
    name = '使能';
    icon = 'characteristic';
  }

  if (icon === 'agile-backlog') {
    icon = 'highlight';
  }

  var reverse = ['agile_epic', 'agile_story', 'agile_fault', 'agile_task', 'agile_subtask', 'test-case', 'test-automation', 'agile-feature'].includes(icon);
  return /*#__PURE__*/React.createElement("div", {
    className: "c7n-typeTag",
    style: style
  }, !reverse ? /*#__PURE__*/React.createElement(_Icon, {
    className: "c7n-typeTag-icon-normal",
    style: {
      transition: 'none',
      fontSize: iconSize * 15 / 24 || '15px',
      background: colour || '#fab614',
      color: 'white'
    },
    type: icon
  }) : /*#__PURE__*/React.createElement(_Icon, {
    style: {
      transition: 'none',
      fontSize: iconSize || '26px',
      color: colour || '#fab614'
    },
    type: icon || 'help'
  }), showName && /*#__PURE__*/React.createElement("span", {
    className: "name"
  }, name));
});
export default IssueType;