| 210 | }; |
| 211 | |
| 212 | function SortableTh({ col, label, className, textAlign = "left", sort, onSort }: SortableThProps) { |
| 213 | const active = sort.key === col; |
| 214 | return ( |
| 215 | <th |
| 216 | scope="col" |
| 217 | className={cn( |
| 218 | "align-middle border-b border-border/50 bg-muted/20 px-3 py-2.5 text-left font-medium first:pl-4 last:pr-4", |
| 219 | textAlign === "right" && "text-right", |
| 220 | className, |
| 221 | )} |
| 222 | aria-sort={active ? (sort.dir === "asc" ? "ascending" : "descending") : "none"} |
| 223 | > |
| 224 | <button |
| 225 | type="button" |
| 226 | onClick={() => onSort(col)} |
| 227 | className={cn( |
| 228 | "inline-flex w-full max-w-full items-center gap-1.5 text-[10px] font-semibold uppercase tracking-[0.1em] text-muted-foreground transition-colors hover:text-foreground", |
| 229 | textAlign === "right" && "justify-end", |
| 230 | )} |
| 231 | > |
| 232 | <span className="truncate">{label}</span> |
| 233 | {active ? ( |
| 234 | sort.dir === "asc" ? ( |
| 235 | <ArrowUp className="h-3.5 w-3.5 shrink-0 text-primary" aria-hidden /> |
| 236 | ) : ( |
| 237 | <ArrowDown className="h-3.5 w-3.5 shrink-0 text-primary" aria-hidden /> |
| 238 | ) |
| 239 | ) : ( |
| 240 | <span className="inline-flex w-3.5 shrink-0" aria-hidden /> |
| 241 | )} |
| 242 | </button> |
| 243 | </th> |
| 244 | ); |
| 245 | } |
| 246 | |
| 247 | function AgentListRow({ item, onAgentsChanged }: { item: AgentResponse; onAgentsChanged?: () => Promise<void> | void }) { |
| 248 | const { agent, deploymentReady, accepted } = item; |