import type { ExecutionAgentQueue } from "@paperclipai/shared";
import { Hourglass } from "lucide-react";
import { Link } from "@/lib/router";
import { agentQueueConfigureHref, agentQueueWaitParts } from "@/lib/agent-queue-wait";
import { cn } from "@/lib/utils";
/**
* A run that waits for one of its agent's concurrency slots:
* "Waiting for Codie · 20 slots max · 41 of 295 in line · Configure".
* It is a quiet system wait, not work in progress: no spinner, no elapsed timer.
*/
export function AgentQueueWait({
queue,
showConfigure = true,
className,
}: {
queue: ExecutionAgentQueue;
showConfigure?: boolean;
className?: string;
}) {
const [waiting, limit, line] = agentQueueWaitParts(queue);
return (
{waiting}·{limit}·{line}
{showConfigure ? (
<>
·
Configure
>
) : null}
);
}
/** List-row form: one muted word, the full sentence on hover. */
export function AgentQueueWaitChip({ queue }: { queue: ExecutionAgentQueue | null }) {
const title = queue ? agentQueueWaitParts(queue).join(" · ") : "Waiting to start";
return (
Waiting
);
}