import Buffer from "buffer";
import processBrowser from "process/browser";
import console from "console-browserify";
var buffer = {
  Buffer
};
import { jsx } from "react/jsx-runtime";
import {
  ArrowRightOutlined,
  CheckOutlined,
  ClockCircleOutlined,
  CloseOutlined,
  LogoutOutlined,
  MinusOutlined,
  WarningOutlined
} from "@ant-design/icons";
function timeCostStrElement(timeCost) {
  let str;
  if (typeof timeCost !== "number") {
    str = "-";
  } else {
    str = `${(timeCost / 1e3).toFixed(2)}s`;
  }
  return /* @__PURE__ */ jsx(
    "span",
    {
      style: {
        fontVariantNumeric: "tabular-nums",
        fontFeatureSettings: "tnum"
      },
      children: str
    }
  );
}
const iconForStatus = (status) => {
  switch (status) {
    case "finished":
    case "passed":
    case "success":
    case "connected":
      return /* @__PURE__ */ jsx("span", { style: { color: "#2B8243" }, children: /* @__PURE__ */ jsx(CheckOutlined, {}) });
    case "finishedWithWarning":
      return /* @__PURE__ */ jsx("span", { style: { color: "#f7bb05" }, children: /* @__PURE__ */ jsx(WarningOutlined, {}) });
    case "failed":
    case "timedOut":
    case "interrupted":
      return /* @__PURE__ */ jsx("span", { style: { color: "#FF0A0A" }, children: /* @__PURE__ */ jsx(CloseOutlined, {}) });
    case "pending":
      return /* @__PURE__ */ jsx(ClockCircleOutlined, {});
    case "cancelled":
    case "skipped":
      return /* @__PURE__ */ jsx(LogoutOutlined, {});
    case "running":
      return /* @__PURE__ */ jsx(ArrowRightOutlined, {});
    default:
      return /* @__PURE__ */ jsx(MinusOutlined, {});
  }
};
export {
  iconForStatus,
  timeCostStrElement
};
