import { statusLabels } from "@/features/host-org/constants.js";

export function HostOrgStatus({ value }) {
  const status = value || "-";
  const tone = getStatusTone(status);

  return (
    <span className={`status-badge status-badge--${tone}`}>
      <span className="status-point" />
      {statusLabels[status] || status}
    </span>
  );
}

function getStatusTone(status) {
  if (status === "active" || status === "approved") {
    return "running";
  }
  if (status === "pending") {
    return "warning";
  }
  if (status === "closed" || status === "disabled" || status === "rejected") {
    return "danger";
  }
  return "stopped";
}
