diff --git a/src/components/ui/password-input.tsx b/src/components/ui/password-input.tsx new file mode 100644 index 00000000..b5b397d6 --- /dev/null +++ b/src/components/ui/password-input.tsx @@ -0,0 +1,52 @@ +import * as React from "react" +import { Eye, EyeOff } from "lucide-react" +import { cn } from "@/lib/utils" + +export interface PasswordInputProps + extends React.InputHTMLAttributes {} + +const PasswordInput = React.forwardRef( + ({ className, ...props }, ref) => { + const [showPassword, setShowPassword] = React.useState(false) + const [isFocused, setIsFocused] = React.useState(false) + + return ( +
+ { + setIsFocused(true) + props.onFocus?.(e) + }} + onBlur={(e) => { + setIsFocused(false) + props.onBlur?.(e) + }} + {...props} + /> + +
+ ) + } +) +PasswordInput.displayName = "PasswordInput" + +export { PasswordInput } diff --git a/src/pages/AISettings.tsx b/src/pages/AISettings.tsx index e7f7cabf..61810ad4 100644 --- a/src/pages/AISettings.tsx +++ b/src/pages/AISettings.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { Check, Bot, ArrowLeft, Trash2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; +import { PasswordInput } from '@/components/ui/password-input'; import { Label } from '@/components/ui/label'; import { Separator } from '@/components/ui/separator'; import { Badge } from '@/components/ui/badge'; @@ -245,9 +246,8 @@ export function AISettings() { {!provider?.nostr && (
- handleUpdateProvider(providerId, { apiKey: e.target.value })} @@ -286,9 +286,8 @@ export function AISettings() {
{!preset.nostr && ( - setPresetApiKeys(prev => ({ @@ -368,9 +367,8 @@ export function AISettings() { {customAuthMethod === 'api-key' && (
- setCustomApiKey(e.target.value)}