import { Heartbeat, Lightning, Trash, XCircle } from "@phosphor-icons/react"; import type { AgentRecord } from "@shared/types"; import { ActionButton, Select } from "../ui"; import { formatMoney, formatTime } from "../../lib/formatters"; export function BudgetBar({ spent, budget }: { spent: number; budget: number }) { const pct = budget > 0 ? Math.min((spent / budget) * 100, 100) : 0; const overBudget = spent > budget && budget > 0; return (
{formatMoney(spent)} / {formatMoney(budget)}
); } export function ConfirmDelete({ entityLabel, onConfirm, onCancel, }: { entityLabel: string; onConfirm: () => void; onCancel: () => void; }) { return (
Delete {entityLabel}?
); } const HEARTBEAT_INTERVALS = [ { value: "30", label: "30 seconds" }, { value: "60", label: "1 minute" }, { value: "120", label: "2 minutes" }, { value: "300", label: "5 minutes" }, { value: "600", label: "10 minutes" }, { value: "1800", label: "30 minutes" }, { value: "3600", label: "1 hour" }, ]; export function HeartbeatSection({ agent, companyId, pendingApproval, persistedConnectorIssue, onSaved, }: { agent: AgentRecord; companyId: string; pendingApproval: boolean; persistedConnectorIssue: string | null; onSaved: () => Promise; }) { return (
Continuous Execution
{agent.heartbeatEnabled && ( Every {agent.heartbeatIntervalSec}s{agent.lastHeartbeatAt ? ` ยท Last: ${formatTime(agent.lastHeartbeatAt)}` : ""} )}
{agent.heartbeatEnabled && (