fix(agent-task/shared): add SessionSymbol func
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
09e1f2532d
commit
e68e28ddf3
1 changed files with 14 additions and 0 deletions
|
|
@ -46,3 +46,17 @@ func SessionStateString(state string) string {
|
|||
return state
|
||||
}
|
||||
}
|
||||
|
||||
type ColorFunc func(string) string
|
||||
|
||||
func SessionSymbol(cs *iostreams.ColorScheme, state string) string {
|
||||
noColor := func(s string) string { return s }
|
||||
switch state {
|
||||
case "completed":
|
||||
return cs.SuccessIconWithColor(noColor)
|
||||
case "failed", "timed_out", "cancelled":
|
||||
return cs.FailureIconWithColor(noColor)
|
||||
default:
|
||||
return "-"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue