import { Link } from "@tanstack/react-router"; import { CheckCircleIcon, GitBranchIcon, GitPullRequestIcon } from "@phosphor-icons/react"; import { formatRelativeTime } from "@/lib/agents/api"; import type { AgentThread } from "@/lib/agents/types"; import { cn } from "@/lib/utils"; interface AgentRunCardProps { thread: AgentThread; } export function AgentRunCard({ thread }: AgentRunCardProps) { const stats = thread.diffStats; const hasPr = Boolean(thread.pr); return (
{stats ? ( <>
{stats.files} {stats.files === 1 ? "file" : "files"}
+{stats.additions} -{stats.deletions}
) : ( )}
{hasPr ? ( <> Draft ) : ( <> Branch )}
{thread.title}
{thread.model} · {thread.repo} · {formatRelativeTime(thread.updatedAt)}
); }