From 74b5f60df83c490f2cf03123793b53dbb5df07e3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 3 Dec 2025 23:02:50 -0600 Subject: [PATCH] Improve Get Key inputs --- src/components/ui/password-input.tsx | 40 +++++++++++++++++----------- src/pages/DeploySettings.tsx | 3 ++- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/components/ui/password-input.tsx b/src/components/ui/password-input.tsx index 1b19f661..a9f915fd 100644 --- a/src/components/ui/password-input.tsx +++ b/src/components/ui/password-input.tsx @@ -2,8 +2,13 @@ import * as React from "react" import { Eye, EyeOff } from "lucide-react" import { cn } from "@/lib/utils" -const PasswordInput = React.forwardRef>( - ({ className, ...props }, ref) => { +interface PasswordInputProps extends React.InputHTMLAttributes { + /** Whether to show the visibility toggle button. Defaults to true. */ + showToggle?: boolean; +} + +const PasswordInput = React.forwardRef( + ({ className, showToggle = true, ...props }, ref) => { const [showPassword, setShowPassword] = React.useState(false) const [isFocused, setIsFocused] = React.useState(false) @@ -12,7 +17,8 @@ const PasswordInput = React.forwardRef - + {showToggle && ( + + )} ) } diff --git a/src/pages/DeploySettings.tsx b/src/pages/DeploySettings.tsx index 03401809..5329eaa1 100644 --- a/src/pages/DeploySettings.tsx +++ b/src/pages/DeploySettings.tsx @@ -808,11 +808,12 @@ export function DeploySettings() { handleAddPresetProvider(preset); } }} + showToggle={!!presetApiKeys[preset.id]} /> {preset.apiKeyURL && !presetApiKeys[preset.id] && (