(options: {
isPausing: boolean;
isTask: boolean;
taskStatus?: string | null;
isStartingStatus: boolean;
isStopStatus: boolean;
curAgentState: AgentState;
})
| 742 | * }) // Returns "var(--oh-status-success)" |
| 743 | */ |
| 744 | export const getStatusColor = (options: { |
| 745 | isPausing: boolean; |
| 746 | isTask: boolean; |
| 747 | taskStatus?: string | null; |
| 748 | isStartingStatus: boolean; |
| 749 | isStopStatus: boolean; |
| 750 | curAgentState: AgentState; |
| 751 | }): string => { |
| 752 | const { |
| 753 | isPausing, |
| 754 | isTask, |
| 755 | taskStatus, |
| 756 | isStartingStatus, |
| 757 | isStopStatus, |
| 758 | curAgentState, |
| 759 | } = options; |
| 760 | |
| 761 | // Show pausing status |
| 762 | if (isPausing) { |
| 763 | return "#FFD600"; |
| 764 | } |
| 765 | |
| 766 | // Show task status if we're polling a task |
| 767 | if (isTask && taskStatus) { |
| 768 | if (taskStatus === "ERROR") { |
| 769 | return OH_STATUS_ERROR_COLOR; |
| 770 | } |
| 771 | return "#FFD600"; |
| 772 | } |
| 773 | |
| 774 | if (isStartingStatus) { |
| 775 | return "#FFD600"; |
| 776 | } |
| 777 | if (isStopStatus) { |
| 778 | return "#ffffff"; |
| 779 | } |
| 780 | if (curAgentState === AgentState.ERROR) { |
| 781 | return OH_STATUS_ERROR_COLOR; |
| 782 | } |
| 783 | return OH_STATUS_SUCCESS_COLOR; |
| 784 | }; |
| 785 | |
| 786 | interface GetStatusTextArgs { |
| 787 | isPausing: boolean; |
no outgoing calls
no test coverage detected