diff --git a/ui/litellm-dashboard/.eslintrc.json b/ui/litellm-dashboard/.eslintrc.json index e8a86074c99..e8d4d24a0f4 100644 --- a/ui/litellm-dashboard/.eslintrc.json +++ b/ui/litellm-dashboard/.eslintrc.json @@ -51,6 +51,7 @@ "src/components/common_components/PremiumLoggingSettings.tsx", "src/components/common_components/AutoRotationView.tsx", "src/components/agents/agent_card.tsx", + "src/components/agents/agent_table.tsx", "src/components/permissions/VectorStorePermissions.tsx", "src/components/permissions/AgentPermissions.tsx", "src/components/permissions/MCPServerPermissions.tsx", diff --git a/ui/litellm-dashboard/src/components/agents/agent_table.tsx b/ui/litellm-dashboard/src/components/agents/agent_table.tsx index 7634c4396f1..93717b5f031 100644 --- a/ui/litellm-dashboard/src/components/agents/agent_table.tsx +++ b/ui/litellm-dashboard/src/components/agents/agent_table.tsx @@ -1,8 +1,27 @@ import React, { useState } from "react"; -import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Button } from "@tremor/react"; -import { SwitchVerticalIcon, ChevronUpIcon, ChevronDownIcon, TrashIcon } from "@heroicons/react/outline"; -import { Tooltip } from "antd"; -import { CopyOutlined } from "@ant-design/icons"; +// eslint-disable-next-line litellm-ui/no-banned-ui-imports +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeaderCell, + TableRow, +} from "@tremor/react"; +import { Button } from "@/components/ui/button"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { + ArrowUpDown, + ChevronDown, + ChevronUp, + Copy, + Trash2, +} from "lucide-react"; import { Agent } from "./types"; import { ColumnDef, @@ -27,12 +46,12 @@ const AgentTable: React.FC = ({ agentsList, isLoading, onDeleteClick, - accessToken, - onAgentUpdated, isAdmin, onAgentClick, }) => { - const [sorting, setSorting] = useState([{ id: "created_at", desc: true }]); + const [sorting, setSorting] = useState([ + { id: "created_at", desc: true }, + ]); const formatDate = (dateString?: string) => { if (!dateString) return "-"; @@ -51,27 +70,40 @@ const AgentTable: React.FC = ({ cell: ({ row }) => { const agent = row.original; const name = agent.agent_name || ""; - return ( + return (
- - + + + + + + {name} - - { - e.stopPropagation(); - copyToClipboard(agent.agent_id); - }} - className="cursor-pointer text-gray-500 hover:text-blue-500 text-xs" - /> - + + + + + + + Copy Agent ID + +
); }, @@ -80,9 +112,10 @@ const AgentTable: React.FC = ({ header: "Description", accessorKey: "agent_card_params.description", cell: ({ row }) => { - const description = row.original.agent_card_params?.description || "No description"; + const description = + row.original.agent_card_params?.description || "No description"; return ( - + {description} ); @@ -94,9 +127,14 @@ const AgentTable: React.FC = ({ cell: ({ row }) => { const agent = row.original; return ( - - {formatDate(agent.created_at)} - + + + + {formatDate(agent.created_at)} + + {agent.created_at} + + ); }, }, @@ -106,24 +144,30 @@ const AgentTable: React.FC = ({ header: "Actions", id: "actions", enableSorting: false, - cell: ({ row }: any) => { + cell: ({ row }: { row: { original: Agent } }) => { const agent = row.original; - + return (
- - + + Delete agent + +
); }, @@ -159,16 +203,25 @@ const AgentTable: React.FC = ({ >
- {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())} + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext(), + )}
{header.column.getIsSorted() ? ( { - asc: , - desc: , + asc: ( + + ), + desc: ( + + ), }[header.column.getIsSorted() as string] ) : ( - + )}
@@ -180,8 +233,11 @@ const AgentTable: React.FC = ({ {isLoading ? ( - -
+ +

Loading...

@@ -190,7 +246,10 @@ const AgentTable: React.FC = ({ table.getRowModel().rows.map((row) => ( {row.getVisibleCells().map((cell) => ( - + {flexRender(cell.column.columnDef.cell, cell.getContext())} ))} @@ -198,15 +257,18 @@ const AgentTable: React.FC = ({ )) ) : ( - -
+ +

No agents found. Create one to get started.

-
-
+
+
)} - - + +
);