From 07f97eb12a8de058082932c32285b1d2115919e4 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Wed, 24 Sep 2025 10:59:37 -0300 Subject: [PATCH] show/hide api keys with button --- frontend/components/ui/input.tsx | 29 +++++++++++++++---- .../onboarding/components/ibm-onboarding.tsx | 1 + .../components/openai-onboarding.tsx | 1 + 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/frontend/components/ui/input.tsx b/frontend/components/ui/input.tsx index 5ba0eba0..2a5f9f89 100644 --- a/frontend/components/ui/input.tsx +++ b/frontend/components/ui/input.tsx @@ -1,3 +1,4 @@ +import { Eye, EyeOff } from "lucide-react"; import * as React from "react"; import { cn } from "@/lib/utils"; @@ -12,6 +13,11 @@ const Input = React.forwardRef( const [hasValue, setHasValue] = React.useState( Boolean(props.value || props.defaultValue), ); + const [showPassword, setShowPassword] = React.useState(false); + + const handleTogglePassword = () => { + setShowPassword(!showPassword); + }; const handleChange = (e: React.ChangeEvent) => { setHasValue(e.target.value.length > 0); @@ -23,8 +29,8 @@ const Input = React.forwardRef( return ( ); - } + }, ); Input.displayName = "Input"; diff --git a/frontend/src/app/onboarding/components/ibm-onboarding.tsx b/frontend/src/app/onboarding/components/ibm-onboarding.tsx index 550f9d6b..379ffc55 100644 --- a/frontend/src/app/onboarding/components/ibm-onboarding.tsx +++ b/frontend/src/app/onboarding/components/ibm-onboarding.tsx @@ -81,6 +81,7 @@ export function IBMOnboarding({ label="IBM API key" helperText="The API key for your watsonx.ai account." id="api-key" + type="password" required placeholder="your-api-key" value={apiKey} diff --git a/frontend/src/app/onboarding/components/openai-onboarding.tsx b/frontend/src/app/onboarding/components/openai-onboarding.tsx index cf18fb53..e94c1c17 100644 --- a/frontend/src/app/onboarding/components/openai-onboarding.tsx +++ b/frontend/src/app/onboarding/components/openai-onboarding.tsx @@ -58,6 +58,7 @@ export function OpenAIOnboarding({ label="OpenAI API key" helperText="The API key for your OpenAI account." id="api-key" + type="password" required placeholder="sk-..." value={apiKey}