import { ClickableCard } from "@astryxdesign/core/ClickableCard"; import { Icon } from "@astryxdesign/core/Icon"; import { HStack, StackItem, VStack } from "@astryxdesign/core/Layout"; import { Section } from "@astryxdesign/core/Section"; import { Heading, Text } from "@astryxdesign/core/Text"; import { IconActivityHeartbeat } from "@tabler/icons-react"; import { backendLabel, modelLabel } from "../lib/backend-label"; import { styles, type AgentRow } from "../lib/agent-rows"; import { ActiveTasks } from "./ActiveTasks"; import { ActivityChart } from "./ActivityChart"; import { AgentAvatar } from "./AgentAvatar"; import { AgentStatusLabel } from "./AgentStatusLabel"; import { BackendLogo } from "./BackendLogo"; function compactHeartbeat(value: string) { if (value === "Never") return "—"; const match = value.match(/^(\d+)\s+(second|minute|hour)/); if (!match) return value; const unit = match[2] === "second" ? "s" : match[2] === "minute" ? "m" : "h"; return `${match[1]}${unit}`; } export function AgentCard({ agent }: { agent: AgentRow }) { return ( {agent.name} {backendLabel(agent.backend)} {modelLabel(agent.modelOverride)} {agent.description}
Active tasks {compactHeartbeat(agent.lastHeartbeat)}
); }