diff --git a/ui/litellm-dashboard/src/components/ui/AntDLoadingSpinner.tsx b/ui/litellm-dashboard/src/components/ui/AntDLoadingSpinner.tsx index 9e90f77584a..798492c6ca2 100644 --- a/ui/litellm-dashboard/src/components/ui/AntDLoadingSpinner.tsx +++ b/ui/litellm-dashboard/src/components/ui/AntDLoadingSpinner.tsx @@ -1,12 +1,26 @@ -import { Spin } from "antd"; -import { LoadingOutlined } from "@ant-design/icons"; +import { Loader2 } from "lucide-react"; +import { cn } from "@/lib/utils"; interface AntDLoadingSpinnerProps { size?: "small" | "default" | "large"; fontSize?: number; } +/** + * Back-compat spinner. The name is preserved for a growing number of + * call sites; the implementation is now a lucide Loader2 sized via + * Tailwind. + */ export function AntDLoadingSpinner({ size, fontSize }: AntDLoadingSpinnerProps) { - const indicator = ; - return ; + const sizeClass = cn( + size === "small" && "h-3 w-3", + size === "large" && "h-6 w-6", + !size || size === "default" ? "h-4 w-4" : "", + ); + return ( + + ); } diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.tsx index 6463abf89d4..cda1e0fafb6 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/JsonViewer.tsx @@ -1,21 +1,22 @@ -import { Typography } from "antd"; import { JsonView, defaultStyles } from "react-json-view-lite"; import "react-json-view-lite/dist/index.css"; -import { JSON_MAX_HEIGHT, COLOR_BG_LIGHT, SPACING_LARGE } from "./constants"; - -const { Text } = Typography; +import { + JSON_MAX_HEIGHT, + COLOR_BG_LIGHT, + SPACING_LARGE, +} from "./constants"; interface JsonViewerProps { + // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any; mode: "formatted"; } /** * Displays JSON data in formatted tree view. - * Uses an interactive tree component for easy navigation. */ export function JsonViewer({ data }: JsonViewerProps) { - if (!data) return No data; + if (!data) return No data; return (
- {total.toLocaleString()} ({prompt.toLocaleString()} prompt tokens + {completion.toLocaleString()} completion - tokens) - + + {total.toLocaleString()} ({prompt.toLocaleString()} prompt tokens +{" "} + {completion.toLocaleString()} completion tokens) + ); } diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.tsx index b03895808d6..eca68471614 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/TruncatedValue.tsx @@ -1,7 +1,16 @@ -import { Typography, Tooltip } from "antd"; -import { DEFAULT_MAX_WIDTH, FONT_FAMILY_MONO, FONT_SIZE_SMALL } from "./constants"; - -const { Text } = Typography; +import React, { useState } from "react"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { Check, Copy } from "lucide-react"; +import { + DEFAULT_MAX_WIDTH, + FONT_FAMILY_MONO, + FONT_SIZE_SMALL, +} from "./constants"; interface TruncatedValueProps { value?: string; @@ -9,27 +18,67 @@ interface TruncatedValueProps { } /** - * Displays a truncated value with tooltip and copy functionality. - * Useful for displaying long IDs, URLs, or other text that may overflow. + * Displays a truncated value with hover tooltip and inline copy button. */ -export function TruncatedValue({ value, maxWidth = DEFAULT_MAX_WIDTH }: TruncatedValueProps) { - if (!value) return -; +export function TruncatedValue({ + value, + maxWidth = DEFAULT_MAX_WIDTH, +}: TruncatedValueProps) { + const [copied, setCopied] = useState(false); + if (!value) return -; + + const handleCopy = async (e: React.MouseEvent) => { + e.stopPropagation(); + try { + await navigator.clipboard.writeText(value); + setCopied(true); + setTimeout(() => setCopied(false), 1500); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (_err) { + /* noop */ + } + }; return ( - - - {value} - - + + + + + + {value} + + + + {value} + + + + + + + + + {copied ? "Copied!" : "Copy"} + + + ); }