import { motion, AnimatePresence } from "framer-motion"; import { Button } from "@/shadcn-bridge/heroui/button"; import { Input } from "@/shadcn-bridge/heroui/input"; import { SearchIcon } from "@/components/icons"; interface SearchBarProps { isVisible: boolean; value: string; placeholder?: string; onOpen: () => void; onClose: () => void; onChange: (value: string) => void; } export function SearchBar({ isVisible, value, placeholder = "搜索", onOpen, onClose, onChange, }: SearchBarProps) { return ( // Fixed h-8 so the container never changes height — eliminates the vertical jitter
{!isVisible ? ( ) : ( onChange(e.target.value)} /> )}
); }