Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

refactor(ui): migrate SimpleMessageBlock and SimpleToolCallBlock to shadcn

Yuneng Jiang9355953414f8
diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json
index 8a86305b4cb..3675bb540fc 100644
--- a/ui/litellm-dashboard/eslint-suppressions.json
+++ b/ui/litellm-dashboard/eslint-suppressions.json
@@ -3917,16 +3917,6 @@
"count": 1
}
},
- "src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
"src/components/view_logs/LogDetailsDrawer/TokenFlow.tsx": {
"no-restricted-imports": {
"count": 1
diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx
index 0262f9d7879..2f50981211b 100644
--- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx
+++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleMessageBlock.tsx
@@ -3,12 +3,10 @@
* Used for messages in tree view and last user message
*/
-import { Typography } from "antd";
+import { cn } from "@/lib/cva.config";
import { ToolCall } from "./prettyMessagesTypes";
import { SimpleToolCallBlock } from "./SimpleToolCallBlock";
-const { Text } = Typography;
-
interface SimpleMessageBlockProps {
label: string;
content?: string;
@@ -27,30 +25,15 @@ export function SimpleMessageBlock({ label, content, toolCalls, isCompact = fals
}
return (
- <div style={{ marginBottom: isCompact ? 8 : 0 }}>
- <Text
- type="secondary"
- style={{
- fontSize: 10,
- letterSpacing: "0.5px",
- textTransform: "uppercase",
- display: "block",
- marginBottom: 3,
- }}
- >
- {label}
- </Text>
+ <div className={cn(isCompact && "mb-2")}>
+ <span className="mb-[3px] block text-[10px] uppercase tracking-[0.5px] text-muted-foreground">{label}</span>
{displayContent && (
<div
- style={{
- fontSize: 13,
- lineHeight: 1.7,
- color: "#262626",
- whiteSpace: "pre-wrap",
- wordBreak: "break-word",
- marginBottom: hasToolCalls ? 6 : 0,
- }}
+ className={cn(
+ "whitespace-pre-wrap break-words text-[13px] leading-[1.7] text-foreground",
+ hasToolCalls && "mb-1.5",
+ )}
>
{displayContent}
</div>
diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx
index 42738794e2f..6d69d07682c 100644
--- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx
+++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SimpleToolCallBlock.tsx
@@ -3,11 +3,9 @@
* Used in compact/tree views
*/
-import { Typography } from "antd";
+import { cn } from "@/lib/cva.config";
import { ToolCall } from "./prettyMessagesTypes";
-const { Text } = Typography;
-
interface SimpleToolCallBlockProps {
tool: ToolCall;
compact?: boolean;
@@ -16,46 +14,24 @@ interface SimpleToolCallBlockProps {
export function SimpleToolCallBlock({ tool, compact = false }: SimpleToolCallBlockProps) {
return (
<div
- style={{
- background: "#f8f9fa",
- border: "1px solid #e9ecef",
- borderRadius: 6,
- padding: compact ? "6px 10px" : "10px 14px",
- marginTop: 8,
- fontFamily: "monospace",
- fontSize: 12,
- position: "relative",
- }}
+ className={cn(
+ "relative mt-2 rounded-md border border-border bg-muted font-mono text-xs",
+ compact ? "px-2.5 py-1.5" : "px-3.5 py-2.5",
+ )}
>
{/* Function badge */}
- <div
- style={{
- position: "absolute",
- top: -8,
- left: 12,
- background: "#fff",
- padding: "0 6px",
- fontSize: 10,
- color: "#8c8c8c",
- border: "1px solid #e9ecef",
- borderRadius: 3,
- }}
- >
+ <div className="absolute -top-2 left-3 rounded-[3px] border border-border bg-background px-1.5 text-[10px] text-muted-foreground">
function
</div>
- <Text strong style={{ fontSize: 13, display: "block", marginBottom: 6 }}>
- {tool.name}
- </Text>
+ <span className="mb-1.5 block text-[13px] font-semibold">{tool.name}</span>
{Object.keys(tool.arguments).length > 0 && (
<div>
{Object.entries(tool.arguments).map(([key, value]) => (
- <div key={key} style={{ marginBottom: 2 }}>
- <Text type="secondary" style={{ fontSize: 12 }}>
- {key}:{" "}
- </Text>
- <Text style={{ fontSize: 12 }}>{JSON.stringify(value)}</Text>
+ <div key={key} className="mb-0.5">
+ <span className="text-xs text-muted-foreground">{key}: </span>
+ <span className="text-xs">{JSON.stringify(value)}</span>
</div>
))}
</div>