From 493b28fc9a1e92aac7a356ec0c4e0c5ef98b376f Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 23 Apr 2026 19:25:21 +0000 Subject: [PATCH] feat(ui): prompts/PromptCodeSnippets to shadcn - antd Modal/Button + @tremor Button/Text + @ant-design CodeOutlined \u2192 shadcn Dialog/Button/Select + lucide Code. antd Tabs kept (legacy items prop used across the Generated Code view). - SyntaxHighlighter preserved; 'style={coy as any}' wrapped in eslint-disable. Gates: TS \u2713 | Build \u2713. Co-authored-by: yuneng-jiang --- .../prompt_editor_view/PromptCodeSnippets.tsx | 153 +++++++++++------- 1 file changed, 91 insertions(+), 62 deletions(-) diff --git a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PromptCodeSnippets.tsx b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PromptCodeSnippets.tsx index ed7caf60de8..2f1cbc866c5 100644 --- a/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PromptCodeSnippets.tsx +++ b/ui/litellm-dashboard/src/components/prompts/prompt_editor_view/PromptCodeSnippets.tsx @@ -1,7 +1,20 @@ import React, { useState } from "react"; -import { Modal, Select, Button as AntdButton, Tabs } from "antd"; -import { CodeOutlined } from "@ant-design/icons"; -import { Button as TremorButton, Text } from "@tremor/react"; +import { Tabs } from "antd"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Code } from "lucide-react"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { coy } from "react-syntax-highlighter/dist/esm/styles/prism"; import NotificationsManager from "../../molecules/notifications_manager"; @@ -210,72 +223,88 @@ main();`; return ( <> - + - (!o ? handleCancel() : undefined)} > -
-
- Language - + setSelectedLanguage( + value as "curl" | "python" | "javascript", + ) + } + > + + + + + cURL + Python (OpenAI SDK) + + JavaScript (OpenAI SDK) + + + +
+
- { - navigator.clipboard.writeText(generatedCode); - NotificationsManager.success("Copied to clipboard!"); + + + + - Copy to Clipboard - - - - - - - {generatedCode} - -
+ {generatedCode} + + + ); };