Spaces:
Runtime error
Runtime error
| 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>; | |
| } | |