import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { Eye, EyeOff } from 'lucide-react'; interface InputProps extends React.InputHTMLAttributes { label: string; error?: string; type?: string; } export const Input: React.FC = ({ label, error, type = 'text', className = '', ...props }) => { const [isFocused, setIsFocused] = useState(false); const [showPassword, setShowPassword] = useState(false); const isPassword = type === 'password'; return (
{ setIsFocused(true); props.onFocus?.(e); }} onBlur={(e) => { setIsFocused(false); props.onBlur?.(e); }} className="peer w-full px-4 py-3 bg-transparent text-slate-800 outline-none placeholder-transparent" placeholder={label} /> {isPassword && ( )}
{error && ( {error} )}
); };