| 1 | import { View } from "react-native"; |
| 2 | |
| 3 | import { cn } from "../../lib/cn"; |
| 4 | import type { SubagentRowTone } from "./threadAgentsPresentation"; |
| 5 | |
| 6 | const TONE_CLASS = { |
| 7 | working: "bg-adaptive-sky-600-400", |
| 8 | completed: "bg-adaptive-emerald-600-400", |
| 9 | failed: "bg-adaptive-rose-600-400", |
| 10 | stopped: "bg-foreground-muted", |
| 11 | } as const satisfies Record<SubagentRowTone, string>; |
| 12 | |
| 13 | export const SUBAGENT_TONE_TEXT_CLASS = { |
| 14 | working: "text-adaptive-sky-600-400", |
| 15 | completed: "text-adaptive-emerald-600-400", |
| 16 | failed: "text-adaptive-rose-600-400", |
| 17 | stopped: "text-foreground-muted", |
| 18 | } as const satisfies Record<SubagentRowTone, string>; |
| 19 | |
| 20 | export function SubagentStatusDot({ |
| 21 | tone, |
| 22 | placement = "inline", |
| 23 | }: { |
| 24 | readonly tone: SubagentRowTone; |
| 25 | readonly placement?: "inline" | "sheet"; |
| 26 | }) { |
| 27 | return ( |
| 28 | <View |
| 29 | className={cn( |
| 30 | "shrink-0 rounded-full", |
| 31 | placement === "sheet" ? "h-2 w-2" : "h-1.5 w-1.5", |
| 32 | TONE_CLASS[tone], |
| 33 | )} |
| 34 | /> |
| 35 | ); |
| 36 | } |