diff --git a/ui/litellm-dashboard/.eslintrc.json b/ui/litellm-dashboard/.eslintrc.json index ae9a0137548..1251a9e924e 100644 --- a/ui/litellm-dashboard/.eslintrc.json +++ b/ui/litellm-dashboard/.eslintrc.json @@ -63,6 +63,7 @@ "src/components/prompts/variable_textarea.tsx", "src/components/chat/MCPCredentialsTab.tsx", "src/components/common_components/KeyLifecycleSettings.tsx", + "src/components/guardrails/GuardrailTestPanel.tsx", "src/components/prompts/prompt_editor_view/PromptEditorHeader.tsx", "src/components/prompts/prompt_editor_view/VersionHistorySidePanel.tsx", "src/app/(dashboard)/teams/components/TeamsTable/ModelsCell.tsx", diff --git a/ui/litellm-dashboard/src/components/guardrails/GuardrailTestPanel.tsx b/ui/litellm-dashboard/src/components/guardrails/GuardrailTestPanel.tsx index 8cda73790c6..c2d119f2db6 100644 --- a/ui/litellm-dashboard/src/components/guardrails/GuardrailTestPanel.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/GuardrailTestPanel.tsx @@ -1,19 +1,26 @@ import React, { useState } from "react"; -import { Button } from "@tremor/react"; -import { Input, Typography, Tooltip } from "antd"; -import { CopyOutlined, InfoCircleOutlined } from "@ant-design/icons"; +import { Button } from "@/components/ui/button"; +import { Textarea } from "@/components/ui/textarea"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { Copy, Info } from "lucide-react"; import NotificationsManager from "../molecules/notifications_manager"; import GuardrailTestResults from "./GuardrailTestResults"; -const { TextArea } = Input; -const { Text } = Typography; - interface GuardrailTestPanelProps { guardrailNames: string[]; onSubmit: (text: string) => void; isLoading: boolean; - results: Array<{ guardrailName: string; response_text: string; latency: number }> | null; - errors: Array<{ guardrailName: string; error: Error; latency: number }> | null; + results: + | Array<{ guardrailName: string; response_text: string; latency: number }> + | null; + errors: + | Array<{ guardrailName: string; error: Error; latency: number }> + | null; onClose: () => void; } @@ -23,7 +30,6 @@ export function GuardrailTestPanel({ isLoading, results, errors, - onClose, }: GuardrailTestPanelProps) { const [inputText, setInputText] = useState(""); @@ -82,53 +88,65 @@ export function GuardrailTestPanel({ return (
- Test {guardrailNames.length > 1 ? "guardrails" : "guardrail"} and compare results +
+ Test {guardrailNames.length > 1 ? "guardrails" : "guardrail"}{" "} + and compare results