import React, { PureComponent } from 'react';
import { injectIntl, FormattedMessage } from 'react-intl';
import StatusTags from "../../../../components/status-tag";
import "./index.less";
var Status = injectIntl(function (_ref) {
  var formatMessage = _ref.intl.formatMessage,
      active = _ref.active,
      fail = _ref.fail,
      synchro = _ref.synchro;
  var msg = '';
  var color = '';

  if (synchro) {
    if (fail) {
      msg = 'failed';
      color = '#f44336';
    } else if (active) {
      msg = 'active';
      color = '#00bfa5';
    } else {
      msg = 'stop';
      color = '#cecece';
    }
  } else {
    msg = 'operating';
    color = '#4d90fe';
  } // if (fail) {
  // } else if (synchro && active) {
  // } else if (active) {
  //   msg = 'creating';
  //   color = '#4d90fe';
  // } else {
  // }


  return /*#__PURE__*/React.createElement(StatusTags, {
    name: formatMessage({
      id: msg
    }),
    color: color
  });
});
export default Status;