Function
getStatusDotColor
(status: string | null | undefined)
Source from the content-addressed store, hash-verified
| 25 | const builderStatus = useAtomValue(model.builderStatusAtom); |
| 26 | |
| 27 | const getStatusDotColor = (status: string | null | undefined): string => { |
| 28 | if (!status) return "bg-gray-500"; |
| 29 | switch (status) { |
| 30 | case "init": |
| 31 | case "stopped": |
| 32 | return "bg-gray-500"; |
| 33 | case "building": |
| 34 | return "bg-warning"; |
| 35 | case "running": |
| 36 | return "bg-success"; |
| 37 | case "error": |
| 38 | return "bg-error"; |
| 39 | default: |
| 40 | return "bg-gray-500"; |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | const statusDotColor = getStatusDotColor(builderStatus?.status); |
| 45 | |
Tested by
no test coverage detected