refactor(cli): share runtime status color rendering

This commit is contained in:
Peter Steinberger
2026-02-18 23:08:35 +00:00
parent 9a100d520d
commit 3ce615ff06
4 changed files with 38 additions and 21 deletions

View File

@@ -27,6 +27,17 @@ export function createCliStatusTextStyles() {
};
}
export function resolveRuntimeStatusColor(status: string | undefined): (value: string) => string {
const runtimeStatus = status ?? "unknown";
return runtimeStatus === "running"
? theme.success
: runtimeStatus === "stopped"
? theme.error
: runtimeStatus === "unknown"
? theme.muted
: theme.warn;
}
export function parsePortFromArgs(programArguments: string[] | undefined): number | null {
if (!programArguments?.length) {
return null;