The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
chore(ui): remove unused NewBadge component and its test
mateo726c2bb6df67
diff --git a/ui/litellm-dashboard/src/components/common_components/NewBadge.test.tsx b/ui/litellm-dashboard/src/components/common_components/NewBadge.test.tsxdeleted file mode 100644index 3ae24b16e7b..00000000000--- a/ui/litellm-dashboard/src/components/common_components/NewBadge.test.tsx+++ /dev/null@@ -1,87 +0,0 @@-import { render, screen } from "@testing-library/react";-import { describe, it, expect, vi, beforeEach } from "vitest";-import NewBadge from "./NewBadge";--// Mock the hook directly-vi.mock("@/app/(dashboard)/hooks/useDisableShowNewBadge", () => ({- useDisableShowNewBadge: vi.fn(),-}));--import { useDisableShowNewBadge } from "@/app/(dashboard)/hooks/useDisableShowNewBadge";--const mockUseDisableShowNewBadge = vi.mocked(useDisableShowNewBadge);--describe("NewBadge", () => {- beforeEach(() => {- vi.clearAllMocks();- });-- it("should render the badge when disableShowNewBadge is false", () => {- mockUseDisableShowNewBadge.mockReturnValue(false);-- render(<NewBadge>Test Content</NewBadge>);-- expect(screen.getByText("New")).toBeInTheDocument();- expect(screen.getByText("Test Content")).toBeInTheDocument();- });-- it("should render the badge when disableShowNewBadge is not set", () => {- mockUseDisableShowNewBadge.mockReturnValue(false);-- render(<NewBadge />);-- expect(screen.getByText("New")).toBeInTheDocument();- });-- it("should render only children when disableShowNewBadge is true", () => {- mockUseDisableShowNewBadge.mockReturnValue(true);-- render(<NewBadge>Test Content</NewBadge>);-- expect(screen.queryByText("New")).not.toBeInTheDocument();- expect(screen.getByText("Test Content")).toBeInTheDocument();- });-- it("should render nothing when disableShowNewBadge is true and no children", () => {- mockUseDisableShowNewBadge.mockReturnValue(true);-- const { container } = render(<NewBadge />);-- expect(container).toBeEmptyDOMElement();- });-- it("should render badge with dot when dot prop is true", () => {- mockUseDisableShowNewBadge.mockReturnValue(false);-- render(<NewBadge dot={true}>Test Content</NewBadge>);-- expect(screen.queryByText("New")).not.toBeInTheDocument();- expect(screen.getByText("Test Content")).toBeInTheDocument();- });-- it("should render badge with 'New' text when dot prop is false", () => {- mockUseDisableShowNewBadge.mockReturnValue(false);-- render(<NewBadge dot={false}>Test Content</NewBadge>);-- expect(screen.getByText("New")).toBeInTheDocument();- expect(screen.getByText("Test Content")).toBeInTheDocument();- });-- it("should render badge with 'New' text when dot prop is not provided (defaults to false)", () => {- mockUseDisableShowNewBadge.mockReturnValue(false);-- render(<NewBadge>Test Content</NewBadge>);-- expect(screen.getByText("New")).toBeInTheDocument();- expect(screen.getByText("Test Content")).toBeInTheDocument();- });-- it("should render badge with dot when dot is true and no children", () => {- mockUseDisableShowNewBadge.mockReturnValue(false);-- render(<NewBadge dot={true} />);-- expect(screen.queryByText("New")).not.toBeInTheDocument();- });-});diff --git a/ui/litellm-dashboard/src/components/common_components/NewBadge.tsx b/ui/litellm-dashboard/src/components/common_components/NewBadge.tsxdeleted file mode 100644index 0184616803e..00000000000--- a/ui/litellm-dashboard/src/components/common_components/NewBadge.tsx+++ /dev/null@@ -1,21 +0,0 @@-import { Badge } from "@/components/ui/badge";-import { useDisableShowNewBadge } from "@/app/(dashboard)/hooks/useDisableShowNewBadge";--export default function NewBadge({ children, dot = false }: { children?: React.ReactNode; dot?: boolean }) {- const disableShowNewBadge = useDisableShowNewBadge();-- if (disableShowNewBadge) {- return children ? <>{children}</> : null;- }-- const badge = dot ? <Badge className="size-1.5 p-0" /> : <Badge>New</Badge>;-- return children ? (- <span className="relative inline-flex">- {children}- <span className="absolute -top-0.5 -right-1">{badge}</span>- </span>- ) : (- badge- );-}