{/* Search input — always visible for autocomplete/type-ahead */}
setSearchQuery(e.target.value)}
className="project-selector__search-input"
data-testid="project-selector-search-input"
aria-label={t("projectSelector.searchAriaLabel", "Type to search projects")}
/>
{searchQuery && (
)}
{/* Exact match indicator */}
{exactMatch && (
{t("projectSelector.exactMatch", "Exact match — press Enter to select")}
)}
{/* Bookmarked projects section */}
{displayProjects.bookmarked.length > 0 && (
{t("projectSelector.bookmarked", "Bookmarked")}
{displayProjects.bookmarked.map((project, index) => (
))}
)}
{/* Recent projects section */}
{displayProjects.recent.length > 0 && (
{t("projectSelector.recent", "Recent")}
{displayProjects.recent.map((project, index) => {
const actualIndex = displayProjects.bookmarked.length + index;
return (
);
})}
)}
{/* All projects section */}
{(displayProjects.bookmarked.length > 0 || displayProjects.recent.length > 0) && (
{t("projectSelector.allProjects", "All Projects")}
)}
{displayProjects.others.length === 0 && searchQuery ? (
{t("projectSelector.noResults", "No projects match \"{{query}}\"", { query: searchQuery })}
) : (
displayProjects.others.map((project, index) => {
const actualIndex = displayProjects.bookmarked.length + displayProjects.recent.length + index;
const isExactMatch = exactMatch?.id === project.id;
return (
);
})
)}
{/* View All option */}