From 33cb594f057aa74b0bd6938c40363f201238bd0e Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Mon, 23 Mar 2026 21:34:44 -0700 Subject: [PATCH] Migrate regenerate key modal from Tremor to antd components Replace Tremor Button, Grid, Col, Text, TextInput, Title with antd equivalents (Button, Typography, Input). Use antd Button loading prop instead of manual "Regenerating..." text. Replace Tailwind utility classes with inline styles to match antd patterns. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../organisms/regenerate_key_modal.tsx | 85 ++++++++++--------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/ui/litellm-dashboard/src/components/organisms/regenerate_key_modal.tsx b/ui/litellm-dashboard/src/components/organisms/regenerate_key_modal.tsx index 2fad101c20f..2902c792d5e 100644 --- a/ui/litellm-dashboard/src/components/organisms/regenerate_key_modal.tsx +++ b/ui/litellm-dashboard/src/components/organisms/regenerate_key_modal.tsx @@ -1,6 +1,5 @@ import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized"; -import { Button, Col, Grid, Text, TextInput, Title } from "@tremor/react"; -import { Form, InputNumber, Modal } from "antd"; +import { Button, Form, Input, InputNumber, Modal, Typography } from "antd"; import { add } from "date-fns"; import { useEffect, useState } from "react"; import { CopyToClipboard } from "react-copy-to-clipboard"; @@ -8,6 +7,8 @@ import { KeyResponse } from "../key_team_helpers/key_list"; import NotificationManager from "../molecules/notifications_manager"; import { regenerateKeyCall } from "../networking"; +const { Text, Title } = Typography; + interface RegenerateKeyModalProps { selectedToken: KeyResponse | null; visible: boolean; @@ -159,42 +160,42 @@ export function RegenerateKeyModal({ selectedToken, visible, onClose, onKeyUpdat , ] : [ - , - , ] } > {regeneratedKey ? ( - - Regenerated Key - -

- Please replace your old key with the new key generated. For security reasons,{" "} - you will not be able to view it again through your LiteLLM account. If you lose this secret key, - you will need to generate a new one. -

- - - Key Alias: -
-
{selectedToken?.key_alias || "No alias set"}
-
- New Virtual Key: -
-
{regeneratedKey}
-
- NotificationManager.success("Virtual Key copied to clipboard")} - > - - - -
+
+ Regenerated Key +

+ Please replace your old key with the new key generated. For security reasons,{" "} + you will not be able to view it again through your LiteLLM account. If you lose this secret key, + you will need to generate a new one. +

+ Key Alias: +
+
+              {selectedToken?.key_alias || "No alias set"}
+            
+
+ New Virtual Key: +
+
+              {regeneratedKey}
+            
+
+ NotificationManager.success("Virtual Key copied to clipboard")} + > + + +
) : (
- + @@ -217,18 +218,20 @@ export function RegenerateKeyModal({ selectedToken, visible, onClose, onKeyUpdat - - + + -
+ Current expiry: {selectedToken?.expires ? new Date(selectedToken.expires).toLocaleString() : "Never"} -
- {newExpiryTime &&
New expiry: {newExpiryTime}
} + + {newExpiryTime && ( +
New expiry: {newExpiryTime}
+ )} - + -
+ Recommended: 24h to 72h for production keys to allow seamless client migration. -
+ )}