diff --git a/ui/litellm-dashboard/src/components/CostTrackingSettings/add_provider_form.tsx b/ui/litellm-dashboard/src/components/CostTrackingSettings/add_provider_form.tsx index 7f79a6848bb..f0195fe2715 100644 --- a/ui/litellm-dashboard/src/components/CostTrackingSettings/add_provider_form.tsx +++ b/ui/litellm-dashboard/src/components/CostTrackingSettings/add_provider_form.tsx @@ -1,8 +1,19 @@ import React from "react"; -import { TextInput, Button } from "@tremor/react"; -import { Select as AntdSelect, Form, Tooltip } from "antd"; -import { InfoCircleOutlined } from "@ant-design/icons"; -import { Providers, provider_map, providerLogoMap } from "../provider_info_helpers"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { Select as AntdSelect, Form } from "antd"; +import { Info } from "lucide-react"; +import { + Providers, + provider_map, + providerLogoMap, +} from "../provider_info_helpers"; import { DiscountConfig } from "./types"; import { handleImageError } from "./provider_display_helpers"; @@ -27,11 +38,18 @@ const AddProviderForm: React.FC = ({
+ Provider - - - + + + + + + + Select the LLM provider you want to configure a discount for + + + } rules={[{ required: true, message: "Please select a provider" }]} @@ -45,58 +63,73 @@ const AddProviderForm: React.FC = ({ size="large" optionFilterProp="children" filterOption={(input, option) => - String(option?.label ?? "").toLowerCase().includes(input.toLowerCase()) + String(option?.label ?? "") + .toLowerCase() + .includes(input.toLowerCase()) } > - {Object.entries(Providers).map(([providerEnum, providerDisplayName]) => { - const providerValue = provider_map[providerEnum as keyof typeof provider_map]; - // Only show providers that don't already have a discount configured - if (providerValue && discountConfig[providerValue]) { - return null; - } - return ( - -
- {`${providerEnum} handleImageError(e, providerDisplayName)} - /> - {providerDisplayName} -
-
- ); - })} + {Object.entries(Providers).map( + ([providerEnum, providerDisplayName]) => { + const providerValue = + provider_map[providerEnum as keyof typeof provider_map]; + if (providerValue && discountConfig[providerValue]) { + return null; + } + return ( + +
+ {/* eslint-disable-next-line @next/next/no-img-element */} + {`${providerEnum} handleImageError(e, providerDisplayName)} + /> + {providerDisplayName} +
+
+ ); + }, + )}
+ Discount Percentage - - - + + + + + + + Enter a percentage value (e.g., 5 for 5% discount) + + + } rules={[{ required: true, message: "Please enter a discount percentage" }]} >
- onDiscountChange(e.target.value)} + className="rounded-lg flex-1" /> - % + %
-
-