diff --git a/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx b/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx new file mode 100644 index 00000000000..5c0407c6cab --- /dev/null +++ b/ui/litellm-dashboard/src/app/(dashboard)/agents/components/agent-list.tsx @@ -0,0 +1,62 @@ +"use client"; + +import Link from "next/link"; +import { Card, Table, Tag, Typography, Empty } from "antd"; +import type { ColumnsType } from "antd/es/table"; +import dayjs from "dayjs"; +import type { CloudAgent } from "@/types/cloud-agents"; + +const { Text } = Typography; + +interface AgentListProps { + agents: CloudAgent[]; + loading: boolean; +} + +export default function AgentList({ agents, loading }: AgentListProps) { + const columns: ColumnsType = [ + { + title: "Name", + dataIndex: "name", + key: "name", + render: (_value: unknown, record: CloudAgent) => ( + + {record.name} + + ), + }, + { + title: "Model", + dataIndex: "model", + key: "model", + render: (value: string) => {value}, + }, + { + title: "Sessions", + dataIndex: "session_count", + key: "session_count", + width: 100, + }, + { + title: "Last activity", + dataIndex: "last_activity_at", + key: "last_activity_at", + render: (value: string | null) => (value ? dayjs(value).fromNow?.() ?? dayjs(value).format("YYYY-MM-DD HH:mm") : "—"), + }, + ]; + + return ( + + + rowKey="agent_id" + dataSource={agents} + columns={columns} + loading={loading} + locale={{ + emptyText: , + }} + data-testid="agents-table" + /> + + ); +}