diff --git a/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_detail.tsx b/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_detail.tsx index 45ff0c57809..f9ac290c762 100644 --- a/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_detail.tsx +++ b/ui/litellm-dashboard/src/components/guardrails/guardrail_garden_detail.tsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; -import { Button } from "antd"; -import { ArrowLeftOutlined } from "@ant-design/icons"; +import { Button } from "@/components/ui/button"; +import { cn } from "@/lib/utils"; +import { ArrowLeft } from "lucide-react"; import AddGuardrailForm from "./add_guardrail_form"; import { GUARDRAIL_PRESETS } from "./guardrail_garden_configs"; import { GuardrailCardInfo } from "./guardrail_garden_data"; @@ -22,11 +23,25 @@ const GuardrailDetailView: React.FC = ({ const [activeTab, setActiveTab] = useState("overview"); const detailRows = [ - { property: "Provider", value: card.category === "litellm" ? "LiteLLM Content Filter" : "Partner Guardrail" }, - ...(card.subcategory ? [{ property: "Subcategory", value: card.subcategory }] : []), - ...(card.category === "litellm" ? [{ property: "Cost", value: "$0 / request" }] : []), - ...(card.category === "litellm" ? [{ property: "External Dependencies", value: "None" }] : []), - ...(card.category === "litellm" ? [{ property: "Latency", value: card.eval?.latency || "<1ms" }] : []), + { + property: "Provider", + value: + card.category === "litellm" + ? "LiteLLM Content Filter" + : "Partner Guardrail", + }, + ...(card.subcategory + ? [{ property: "Subcategory", value: card.subcategory }] + : []), + ...(card.category === "litellm" + ? [{ property: "Cost", value: "$0 / request" }] + : []), + ...(card.category === "litellm" + ? [{ property: "External Dependencies", value: "None" }] + : []), + ...(card.category === "litellm" + ? [{ property: "Latency", value: card.eval?.latency || "<1ms" }] + : []), ]; const evalRows = card.eval @@ -47,147 +62,135 @@ const GuardrailDetailView: React.FC = ({ ]; return ( -
+
{/* Back link */} -
- + {card.name} -
+ - {/* ── Header block (Vertex-style) ── */} -
+ {/* Header block */} +
+ {/* eslint-disable-next-line @next/next/no-img-element */} { (e.target as HTMLImageElement).style.display = "none"; }} + className="w-10 h-10 rounded-lg object-contain" + onError={(e) => { + (e.target as HTMLImageElement).style.display = "none"; + }} /> -

+

{card.name}

-

+

{card.description}

- {/* Action buttons — outlined style like Vertex */} -
+ {/* Action buttons */} +
- {/* ── Tab bar ──────────────────────────────────── */} -
-
+ {/* Tab bar */} +
+
{tabs.map((tab) => ( -
setActiveTab(tab.key)} - style={{ - padding: "12px 20px", - fontSize: 14, - color: activeTab === tab.key ? "#1a73e8" : "#5f6368", - borderBottom: activeTab === tab.key ? "3px solid #1a73e8" : "3px solid transparent", - cursor: "pointer", - fontWeight: activeTab === tab.key ? 500 : 400, - marginBottom: -1, - }} + className={cn( + "px-5 py-3 text-sm cursor-pointer -mb-px border-b-[3px] border-transparent", + activeTab === tab.key + ? "text-primary border-primary font-medium" + : "text-muted-foreground", + )} > {tab.label} -
+ ))}
- {/* ── Tab content ──────────────────────────────── */} + {/* Tab content */} {activeTab === "overview" && ( -
- {/* Left column — overview + details table */} -
-

Overview

-

+

+
+

+ Overview +

+

{card.description}

-

Guardrail Details

-

Details are as follows

+

+ Guardrail Details +

+

+ Details are as follows +

- +
- - - + + + {detailRows.map((row, i) => ( - - - + + + ))}
Property{card.name}
+ Property + + {card.name} +
{row.property}{row.value}
{row.property}{row.value}
- {/* Right column — metadata sidebar like Vertex */} -
- {/* Guardrail ID */} -
-
Guardrail ID
-
+ {/* Right column — metadata sidebar */} +
+
+
+ Guardrail ID +
+
litellm/{card.id}
- {/* Type */} -
-
Type
-
+
+
Type
+
{card.category === "litellm" ? "Content Filter" : "Partner"}
- {/* Tags — pill style like Vertex */} {card.tags.length > 0 && ( -
-
Tags
-
+
+
Tags
+
{card.tags.map((tag) => ( {tag} @@ -201,19 +204,27 @@ const GuardrailDetailView: React.FC = ({ {activeTab === "eval" && (
-

Eval Results

- +

+ Eval Results +

+
- - - + + + {evalRows.map((row, i) => ( - - - + + + ))}
MetricValue
+ Metric + + Value +
{row.metric}{row.value}
{row.metric} + {row.value} +