diff --git a/ui/litellm-dashboard/src/app/(dashboard)/playground/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/playground/page.tsx index 2b4b4ace491..4ebde1b6d01 100644 --- a/ui/litellm-dashboard/src/app/(dashboard)/playground/page.tsx +++ b/ui/litellm-dashboard/src/app/(dashboard)/playground/page.tsx @@ -5,7 +5,12 @@ import AgentBuilderView from "@/components/playground/chat_ui/AgentBuilderView"; import ChatUI from "@/components/playground/chat_ui/ChatUI"; import CompareUI from "@/components/playground/compareUI/CompareUI"; import ComplianceUI from "@/components/playground/complianceUI/ComplianceUI"; -import { TabGroup, TabList, Tab, TabPanels, TabPanel } from "@tremor/react"; +import { + Tabs, + TabsContent, + TabsList, + TabsTrigger, +} from "@/components/ui/tabs"; import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; import { fetchProxySettings } from "@/utils/proxyUtils"; @@ -15,8 +20,16 @@ interface ProxySettings { } export default function PlaygroundPage() { - const { accessToken, userRole, userId, disabledPersonalKeyCreation, token } = useAuthorized(); - const [proxySettings, setProxySettings] = useState(undefined); + const { + accessToken, + userRole, + userId, + disabledPersonalKeyCreation, + token, + } = useAuthorized(); + const [proxySettings, setProxySettings] = useState( + undefined, + ); useEffect(() => { const initializeProxySettings = async () => { @@ -36,15 +49,19 @@ export default function PlaygroundPage() { return (
- - - Chat - Compare - Compliance - Agent Builder (Experimental) - - - + + + Chat + Compare + Compliance + + Agent Builder (Experimental) + + + - - - - - - - - + + + + + + + + - - - + +
); } diff --git a/ui/litellm-dashboard/src/components/CostTrackingSettings/pricing_calculator/multi_export_dropdown.tsx b/ui/litellm-dashboard/src/components/CostTrackingSettings/pricing_calculator/multi_export_dropdown.tsx index 09cf4e652b9..54f35d4d2d9 100644 --- a/ui/litellm-dashboard/src/components/CostTrackingSettings/pricing_calculator/multi_export_dropdown.tsx +++ b/ui/litellm-dashboard/src/components/CostTrackingSettings/pricing_calculator/multi_export_dropdown.tsx @@ -1,6 +1,12 @@ -import React, { useState, useRef, useEffect } from "react"; -import { Button } from "@tremor/react"; -import { DownloadOutlined, FilePdfOutlined, FileExcelOutlined } from "@ant-design/icons"; +import React from "react"; +import { Button } from "@/components/ui/button"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { Download, FileSpreadsheet, FileText } from "lucide-react"; import { MultiModelResult } from "./types"; import { exportMultiToPDF, exportMultiToCSV } from "./multi_export_utils"; @@ -8,70 +14,35 @@ interface MultiExportDropdownProps { multiResult: MultiModelResult; } -const MultiExportDropdown: React.FC = ({ multiResult }) => { - const [isOpen, setIsOpen] = useState(false); - const menuRef = useRef(null); - +const MultiExportDropdown: React.FC = ({ + multiResult, +}) => { const hasResults = multiResult.entries.some((e) => e.result !== null); - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - if (menuRef.current && !menuRef.current.contains(event.target as Node)) { - setIsOpen(false); - } - }; - - if (isOpen) { - document.addEventListener("mousedown", handleClickOutside); - } - - return () => { - document.removeEventListener("mousedown", handleClickOutside); - }; - }, [isOpen]); - if (!hasResults) { return null; } return ( -
- - - {isOpen && ( -
- - -
- )} -
+ + + + + + exportMultiToPDF(multiResult)}> + + Export as PDF + + exportMultiToCSV(multiResult)}> + + Export as CSV + + + ); }; export default MultiExportDropdown; - diff --git a/ui/litellm-dashboard/src/components/common_components/TableHeaderSortDropdown/TableHeaderSortDropdown.tsx b/ui/litellm-dashboard/src/components/common_components/TableHeaderSortDropdown/TableHeaderSortDropdown.tsx index cbdc8beaaa4..a7724a44b21 100644 --- a/ui/litellm-dashboard/src/components/common_components/TableHeaderSortDropdown/TableHeaderSortDropdown.tsx +++ b/ui/litellm-dashboard/src/components/common_components/TableHeaderSortDropdown/TableHeaderSortDropdown.tsx @@ -1,85 +1,62 @@ import React from "react"; -import { Button, Dropdown, MenuProps } from "antd"; -import { SwitchVerticalIcon, ChevronUpIcon, ChevronDownIcon, XIcon } from "@heroicons/react/outline"; +import { Button } from "@/components/ui/button"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { ArrowUpDown, ChevronDown, ChevronUp, X } from "lucide-react"; +import { cn } from "@/lib/utils"; export type SortState = "asc" | "desc" | false; interface TableHeaderSortDropdownProps { - /** - * Current sort state: "asc", "desc", or false for neutral - */ sortState: SortState; - /** - * Callback when sort state changes - * @param newState - The new sort state: "asc", "desc", or false - */ onSortChange: (newState: SortState) => void; - /** - * Optional column ID for identification - */ columnId?: string; } -export const TableHeaderSortDropdown: React.FC = ({ - sortState, - onSortChange, -}) => { - const handleMenuClick: MenuProps["onClick"] = ({ key }) => { - if (key === "asc") { - onSortChange("asc"); - } else if (key === "desc") { - onSortChange("desc"); - } else if (key === "reset") { - onSortChange(false); - } - }; - - const menuItems: MenuProps["items"] = [ - { - key: "asc", - label: "Ascending", - icon: , - }, - { - key: "desc", - label: "Descending", - icon: , - }, - { - key: "reset", - label: "Reset", - icon: , - }, - ]; - - // Determine which icon to display based on current sort state +export const TableHeaderSortDropdown: React.FC< + TableHeaderSortDropdownProps +> = ({ sortState, onSortChange }) => { const renderIcon = () => { - if (sortState === "asc") { - return ; - } else if (sortState === "desc") { - return ; - } else { - return ; - } + if (sortState === "asc") return ; + if (sortState === "desc") return ; + return ; }; return ( - - + + + onSortChange("asc")}> + + Ascending + + onSortChange("desc")}> + + Descending + + onSortChange(false)}> + + Reset + + + ); }; diff --git a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/index.tsx b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/index.tsx index a7a85226ee4..6f0178cbf32 100644 --- a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/index.tsx +++ b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/conversation_panel/index.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { ClearOutlined } from "@ant-design/icons"; -import { Button as TremorButton } from "@tremor/react"; +import { Eraser } from "lucide-react"; +import { Button } from "@/components/ui/button"; import { ConversationPanelProps } from "./types"; import { useConversation } from "./useConversation"; import VariableInput from "./VariableInput"; @@ -8,7 +8,10 @@ import MessageList from "./MessageList"; import VariableWarning from "./VariableWarning"; import MessageInput from "./MessageInput"; -const ConversationPanel: React.FC = ({ prompt, accessToken }) => { +const ConversationPanel: React.FC = ({ + prompt, + accessToken, +}) => { const { isLoading, messages, @@ -27,7 +30,7 @@ const ConversationPanel: React.FC = ({ prompt, accessTok } = useConversation(prompt, accessToken); return ( -
+
{!variablesFilled && ( = ({ prompt, accessTok )} {messages.length > 0 && ( -
- +
)} @@ -55,14 +59,19 @@ const ConversationPanel: React.FC = ({ prompt, accessTok messagesEndRef={messagesEndRef} /> -
- +
+ 0 && !allVariablesFilled) + isLoading || + !inputMessage.trim() || + (extractedVariables.length > 0 && !allVariablesFilled) } onInputChange={setInputMessage} onSend={handleSendMessage} @@ -75,4 +84,3 @@ const ConversationPanel: React.FC = ({ prompt, accessTok }; export default ConversationPanel; -