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