import React from 'react';
import { injectIntl } from 'react-intl';
import "./index.less";

function PodStatus(props) {
  var _props$dataSource = props.dataSource,
      podCount = _props$dataSource.podCount,
      podRunningCount = _props$dataSource.podRunningCount;
  var strokeWidth = podCount === 0 || podCount > podRunningCount ? 4 : 0;
  var correct = podCount > 0 ? podRunningCount / podCount * (Math.PI * 2 * 10) : 0;
  var circle = /*#__PURE__*/React.createElement("svg", {
    width: "24",
    height: "24"
  }, /*#__PURE__*/React.createElement("circle", {
    cx: "50%",
    cy: "50%",
    r: "10",
    fill: "none",
    strokeWidth: strokeWidth,
    stroke: podCount > 0 ? '#FFB100' : '#f3f3f3'
  }), /*#__PURE__*/React.createElement("circle", {
    cx: "50%",
    cy: "50%",
    r: "10",
    fill: "none",
    className: "c7n-pod-circle-small",
    strokeWidth: "4px",
    stroke: "#0bc2a8",
    strokeDasharray: "".concat(correct, ", 10000")
  }), /*#__PURE__*/React.createElement("text", {
    x: "50%",
    y: "16",
    className: "c7n-pod-circle-num-small"
  }, podCount));
  return /*#__PURE__*/React.createElement("div", {
    className: "c7n-deploy-pod-status"
  }, circle);
}

export default injectIntl(PodStatus);