import React, { useState } from 'react'; import { Search } from 'lucide-react'; const AnimatedSearchInput = ({ value, onChange, isSearching: searching, placeholder }) => { const [isFocused, setIsFocused] = useState(false); const isSearching = searching === true; return (
{/* Background gradient effect */}
{/* Input field with background transitions */} setIsFocused(true)} onBlur={() => setIsFocused(false)} placeholder={placeholder} className={` w-full rounded-lg px-10 py-2 transition-all duration-500 ease-in-out placeholder:text-gray-400 focus:outline-none focus:ring-0 ${isFocused ? 'bg-white/10' : 'bg-white/5'} ${isSearching ? 'bg-white/15' : ''} backdrop-blur-sm `} /> {/* Animated loading indicator */}
{/* Outer glow effect */}
{/* Focus state background glow */}
); }; export default AnimatedSearchInput;