diff --git a/ui/litellm-dashboard/src/components/Projects/ProjectKeysSection.tsx b/ui/litellm-dashboard/src/components/Projects/ProjectKeysSection.tsx index 9f60db596e8..d1d720f841a 100644 --- a/ui/litellm-dashboard/src/components/Projects/ProjectKeysSection.tsx +++ b/ui/litellm-dashboard/src/components/Projects/ProjectKeysSection.tsx @@ -1,7 +1,13 @@ import { useKeys } from "@/app/(dashboard)/hooks/keys/useKeys"; -import { LoadingOutlined } from "@ant-design/icons"; -import { Card, Flex, Input, Pagination, Spin } from "antd"; -import { KeyIcon, SearchIcon } from "lucide-react"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Button } from "@/components/ui/button"; +import { + ChevronLeft, + ChevronRight, + Key as KeyIcon, + Search, +} from "lucide-react"; import { useEffect, useState } from "react"; import { ProjectKeysTable } from "./ProjectKeysTable"; @@ -20,48 +26,62 @@ export function ProjectKeysSection({ projectId }: ProjectKeysSectionProps) { selectedKeyAlias: keyAlias || null, }); - // Reset to page 1 when filter changes useEffect(() => { setPage(1); }, [keyAlias]); const keys = data?.keys ?? []; const totalCount = data?.total_count ?? 0; + const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE)); return ( - + + + Keys - - } - style={{ height: "100%" }} - > - - } - placeholder="Filter by key name..." - style={{ maxWidth: 220 }} - value={keyAlias} - onChange={(e) => setKeyAlias(e.target.value)} - allowClear - size="small" - /> - `${total} keys`} - /> - - } /> } : false} - /> + + + +
+
+ + setKeyAlias(e.target.value)} + /> +
+
+ {totalCount} keys + + + {page}/{totalPages} + + +
+
+ +
); } diff --git a/ui/litellm-dashboard/src/components/Projects/ProjectKeysTable.tsx b/ui/litellm-dashboard/src/components/Projects/ProjectKeysTable.tsx index cb80d0e27a5..590575c9e8a 100644 --- a/ui/litellm-dashboard/src/components/Projects/ProjectKeysTable.tsx +++ b/ui/litellm-dashboard/src/components/Projects/ProjectKeysTable.tsx @@ -1,58 +1,93 @@ import { KeyResponse } from "@/components/key_team_helpers/key_list"; -import { Empty, Table, Tooltip } from "antd"; -import type { ColumnsType } from "antd/es/table"; -import type { SpinProps } from "antd"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { Loader2 } from "lucide-react"; import DefaultProxyAdminTag from "../common_components/DefaultProxyAdminTag"; interface ProjectKeysTableProps { keys: KeyResponse[]; - loading?: boolean | SpinProps; + loading?: boolean; } -const columns: ColumnsType = [ - { - title: "Key Name", - dataIndex: "key_alias", - key: "key_alias", - render: (alias: string | null) => alias || "—", - }, - { - title: "Owner", - key: "owner", - render: (_: unknown, record: KeyResponse) => { - const email = record.user?.user_email ?? record.user_id ?? null; - if (!email) return "—"; - return ( - - - - ); - }, - }, - { - title: "Created", - dataIndex: "created_at", - key: "created_at", - render: (date: string) => (date ? new Date(date).toLocaleDateString() : "—"), - }, - { - title: "Last Active", - dataIndex: "last_active", - key: "last_active", - render: (date: string | null) => (date ? new Date(date).toLocaleDateString() : "Never"), - }, -]; - export function ProjectKeysTable({ keys, loading }: ProjectKeysTableProps) { return ( - }} - /> +
+
+ + + Key Name + Owner + Created + Last Active + + + + {loading ? ( + + + + + + ) : keys.length === 0 ? ( + + + No keys found + + + ) : ( + keys.map((k) => { + const alias = k.key_alias || "—"; + const email = k.user?.user_email ?? k.user_id ?? null; + return ( + + {alias} + + {email ? ( + + + + + + + + {email} + + + ) : ( + "—" + )} + + + {k.created_at + ? new Date(k.created_at).toLocaleDateString() + : "—"} + + + {k.last_active + ? new Date(k.last_active).toLocaleDateString() + : "Never"} + + + ); + }) + )} + +
+ ); } diff --git a/ui/litellm-dashboard/src/components/playground/compareUI/components/MessageInput.tsx b/ui/litellm-dashboard/src/components/playground/compareUI/components/MessageInput.tsx index 67036282b38..b74b1157670 100644 --- a/ui/litellm-dashboard/src/components/playground/compareUI/components/MessageInput.tsx +++ b/ui/litellm-dashboard/src/components/playground/compareUI/components/MessageInput.tsx @@ -1,8 +1,7 @@ import React from "react"; -import { Input, Button } from "antd"; -import { ArrowUpOutlined } from "@ant-design/icons"; - -const { TextArea } = Input; +import { Button } from "@/components/ui/button"; +import { Textarea } from "@/components/ui/textarea"; +import { ArrowUp } from "lucide-react"; interface MessageInputProps { value: string; @@ -13,8 +12,16 @@ interface MessageInputProps { uploadComponent?: React.ReactNode; } -export function MessageInput({ value, onChange, onSend, disabled, hasAttachment, uploadComponent }: MessageInputProps) { - const canSend = !disabled && (value.trim().length > 0 || Boolean(hasAttachment)); +export function MessageInput({ + value, + onChange, + onSend, + disabled, + hasAttachment, + uploadComponent, +}: MessageInputProps) { + const canSend = + !disabled && (value.trim().length > 0 || Boolean(hasAttachment)); const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter" && !e.shiftKey) { @@ -27,27 +34,27 @@ export function MessageInput({ value, onChange, onSend, disabled, hasAttachment, return (
-
- {uploadComponent &&
{uploadComponent}
} -