import { useRef, useEffect } from 'react'; import { Input } from '@/components/ui/input'; import { Search, X } from 'lucide-react'; import { Spinner } from '@/components/ui/spinner'; interface BoardSearchBarProps { searchQuery: string; onSearchChange: (query: string) => void; isCreatingSpec: boolean; creatingSpecProjectPath?: string; currentProjectPath?: string; } export function BoardSearchBar({ searchQuery, onSearchChange, isCreatingSpec, creatingSpecProjectPath, currentProjectPath, }: BoardSearchBarProps) { const searchInputRef = useRef(null); // Focus search input when "/" is pressed useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { // Only focus if not typing in an input/textarea if ( e.key === '/' && !(e.target instanceof HTMLInputElement) && !(e.target instanceof HTMLTextAreaElement) ) { e.preventDefault(); searchInputRef.current?.focus(); } }; window.addEventListener('keydown', handleKeyDown); return () => window.removeEventListener('keydown', handleKeyDown); }, []); return (
onSearchChange(e.target.value)} className="pl-9 pr-12 border-border" data-testid="kanban-search-input" /> {searchQuery ? ( ) : ( / )}
{/* Spec Creation Loading Badge */} {isCreatingSpec && currentProjectPath === creatingSpecProjectPath && (
Creating spec
)}
); }