ai_api / bin /cli /tui-components /StatusBadge.jsx
Yogesh
initial deploy
cd8bd0a
Raw
History Blame Contribute Delete
602 Bytes
import React from "react";
import { Text } from "ink";
const STATUS_MAP = {
running: { label: "● running", color: "green" },
stopped: { label: "● stopped", color: "red" },
starting: { label: "β—Œ starting", color: "yellow" },
error: { label: "βœ— error", color: "red" },
unknown: { label: "? unknown", color: "gray" },
ok: { label: "βœ“ ok", color: "green" },
warn: { label: "⚠ warn", color: "yellow" },
};
export function StatusBadge({ status = "unknown" }) {
const s = STATUS_MAP[status] ?? { label: status, color: "gray" };
return <Text color={s.color}>{s.label}</Text>;
}