MCPcopy Create free account
hub / github.com/Noumena-Network/code / getTaskStatusIcon

Function getTaskStatusIcon

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

Source from the content-addressed store, hash-verified

22 * Returns the appropriate icon for a task based on status and state flags.
23 */
24export function getTaskStatusIcon(status: TaskStatus, options?: {
25 isIdle?: boolean;
26 awaitingApproval?: boolean;
27 hasError?: boolean;
28 shutdownRequested?: boolean;
29}): string {
30 const {
31 isIdle,
32 awaitingApproval,
33 hasError,
34 shutdownRequested
35 } = options ?? {};
36 if (hasError) return figures.cross;
37 if (awaitingApproval) return figures.questionMarkPrefix;
38 if (shutdownRequested) return figures.warning;
39 if (status === 'running') {
40 if (isIdle) return figures.ellipsis;
41 return figures.play;
42 }
43 if (status === 'completed') return figures.tick;
44 if (status === 'failed' || status === 'killed') return figures.cross;
45 return figures.bullet;
46}
47
48/**
49 * Returns the appropriate semantic color for a task based on status and state flags.

Callers 2

WorkflowDetailDialogFunction · 0.85
AsyncAgentDetailDialogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected