An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
refactor(components): remove password visibility toggle
vishnu vc1d224a59788
diff --git a/components/ui/icons.tsx b/components/ui/icons.tsxindex b2ecbbd0..8a00dc9e 100644--- a/components/ui/icons.tsx+++ b/components/ui/icons.tsx@@ -1,7 +1,5 @@'use client'-import { Eye, EyeOff } from 'lucide-react'-import { cn } from '@/lib/utils'function IconLogo({ className, ...props }: React.ComponentProps<'svg'>) {@@ -21,7 +19,4 @@ function IconLogo({ className, ...props }: React.ComponentProps<'svg'>) {)}-const IconEye = Eye-const IconEyeOff = EyeOff--export { IconEye, IconEyeOff, IconLogo }+export { IconLogo }diff --git a/components/ui/input.tsx b/components/ui/input.tsxindex ab1de5ee..d2511deb 100644--- a/components/ui/input.tsx+++ b/components/ui/input.tsx@@ -1,51 +1,22 @@import * as React from 'react'-import { useState } from 'react'import { cn } from '@/lib/utils/index'-import { IconEye, IconEyeOff } from '@/components/ui/icons'--import { Button } from './button'-export interface InputPropsextends React.InputHTMLAttributes<HTMLInputElement> {}const Input = React.forwardRef<HTMLInputElement, InputProps>(({ className, type, ...props }, ref) => {- const [showPassword, setShowPassword] = useState(false)- const inputType = type === 'password' && showPassword ? 'text' : type-- const togglePasswordVisibility = () => {- setShowPassword(!showPassword)- }-return (- <div className="relative">- <input- type={inputType}- className={cn(- 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',- className- )}- ref={ref}- {...props}- />- {type === 'password' && (- <Button- type="button"- variant="ghost"- size="icon"- className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"- onClick={togglePasswordVisibility}- >- {showPassword ? (- <IconEyeOff className="h-4 w-4" />- ) : (- <IconEye className="h-4 w-4" />- )}- </Button>+ <input+ type={type}+ className={cn(+ 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',+ className)}- </div>+ ref={ref}+ {...props}+ />)})