diff --git a/src/components/blog/SearchBar.tsx b/src/components/blog/SearchBar.tsx new file mode 100644 index 0000000..4bc3520 --- /dev/null +++ b/src/components/blog/SearchBar.tsx @@ -0,0 +1,50 @@ +'use client'; + +import { Search, X } from 'lucide-react'; +import { motion } from 'framer-motion'; + +interface SearchBarProps { + value: string; + onChange: (value: string) => void; + placeholder?: string; + className?: string; +} + +export function SearchBar({ + value, + onChange, + placeholder = 'Search posts...', + className = '' +}: SearchBarProps) { + const handleClear = () => { + onChange(''); + }; + + return ( + +
+ + onChange(e.target.value)} + placeholder={placeholder} + className="w-full pl-12 pr-12 py-3 bg-zinc-900/50 border border-zinc-800 rounded-lg text-white placeholder:text-zinc-500 focus:outline-none focus:ring-2 focus:ring-[#697565] focus:border-transparent transition-all" + /> + {value && ( + + )} +
+
+ ); +}