diff --git a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx index 632ea961853..49169dc1226 100644 --- a/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/LogDetailsDrawer/SectionHeader.tsx @@ -1,19 +1,20 @@ -/** - * SectionHeader - Datadog-style header with icon, label, metrics, and copy - */ - -import { Typography, Button, Tooltip } from 'antd'; -import { - MessageOutlined, - CopyOutlined, - DownOutlined, - UpOutlined -} from '@ant-design/icons'; - -const { Text } = Typography; +import { Button } from "@/components/ui/button"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { + ChevronDown, + ChevronUp, + Copy, + MessageSquare, +} from "lucide-react"; +import { cn } from "@/lib/utils"; interface SectionHeaderProps { - type: 'input' | 'output'; + type: "input" | "output"; tokens?: number; cost?: number; onCopy: () => void; @@ -22,87 +23,83 @@ interface SectionHeaderProps { turnCount?: number; } -export function SectionHeader({ type, tokens, cost, onCopy, isCollapsed, onToggleCollapse, turnCount }: SectionHeaderProps) { +export function SectionHeader({ + type, + tokens, + cost, + onCopy, + isCollapsed, + onToggleCollapse, + turnCount, +}: SectionHeaderProps) { return (
{ - if (onToggleCollapse) { - e.currentTarget.style.background = '#f5f5f5'; - } - }} - onMouseLeave={(e) => { - e.currentTarget.style.background = '#fafafa'; - }} + className={cn( + "flex items-center justify-between px-4 py-2.5 bg-muted/50 transition-colors", + !isCollapsed && "border-b border-border", + onToggleCollapse ? "cursor-pointer hover:bg-muted" : "", + )} > -
- {/* Collapse Arrow */} +
{onToggleCollapse && ( -
+
{isCollapsed ? ( - + ) : ( - + )}
)} - {/* Icon + Label */} -
- {type === 'input' ? ( - +
+ {type === "input" ? ( + ) : ( - ✨ + ✨ )} - - {type === 'input' ? 'Input' : 'Output'} - + + {type === "input" ? "Input" : "Output"} +
- {/* Tokens */} {tokens !== undefined && ( - + Tokens: {tokens.toLocaleString()} - + )} - {/* Cost */} {cost !== undefined && ( - + Cost: ${cost.toFixed(6)} - + )} - {/* Turn count */} {turnCount !== undefined && turnCount > 0 && ( - + Turns: {turnCount} - + )}
- {/* Copy Button */} - - + + Copy + +
); }