import React, { Fragment, memo } from 'react';
import PropTypes from 'prop-types';
import StatusDot from "../status-dot";
import "./index.less";
var EnvironmentItem = /*#__PURE__*/memo(function (_ref) {
  var name = _ref.name,
      connect = _ref.connect,
      synchronize = _ref.synchronize,
      active = _ref.active,
      clusterName = _ref.clusterName,
      failed = _ref.failed,
      isTitle = _ref.isTitle,
      formatMessage = _ref.formatMessage;
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(StatusDot, {
    active: active,
    connect: connect,
    failed: failed,
    synchronize: synchronize,
    size: isTitle ? 'normal' : 'small'
  }), isTitle ? /*#__PURE__*/React.createElement("span", {
    className: "c7ncd-env-title"
  }, name) : name, clusterName ? /*#__PURE__*/React.createElement("span", {
    className: "c7ncd-env-cluster"
  }, "(", formatMessage({
    id: 'c7ncd.env.cluster'
  }), ":  ", clusterName, ")") : null);
});
EnvironmentItem.propTypes = {
  name: PropTypes.any.isRequired,
  active: PropTypes.bool,
  connect: PropTypes.bool,
  synchronize: PropTypes.bool,
  failed: PropTypes.bool,
  isTitle: PropTypes.bool
};
EnvironmentItem.defaultProps = {
  active: true,
  failed: false,
  isTitle: false,
  synchronize: true
};
export default EnvironmentItem;