MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getTaskStatusColor

Function getTaskStatusColor

src/components/tasks/taskStatusUtils.tsx:50–70  ·  view source on GitHub ↗
(status: TaskStatus, options?: {
  isIdle?: boolean;
  awaitingApproval?: boolean;
  hasError?: boolean;
  shutdownRequested?: boolean;
})

Source from the content-addressed store, hash-verified

48 * Returns the appropriate semantic color for a task based on status and state flags.
49 */
50export function getTaskStatusColor(status: TaskStatus, options?: {
51 isIdle?: boolean;
52 awaitingApproval?: boolean;
53 hasError?: boolean;
54 shutdownRequested?: boolean;
55}): 'success' | 'error' | 'warning' | 'background' {
56 const {
57 isIdle,
58 awaitingApproval,
59 hasError,
60 shutdownRequested
61 } = options ?? {};
62 if (hasError) return 'error';
63 if (awaitingApproval) return 'warning';
64 if (shutdownRequested) return 'warning';
65 if (isIdle) return 'background';
66 if (status === 'completed') return 'success';
67 if (status === 'failed') return 'error';
68 if (status === 'killed') return 'warning';
69 return 'background';
70}
71
72/**
73 * Derives a human-readable activity string for an in-process teammate,

Callers 1

AsyncAgentDetailDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected