{inputValue.length === 0 ? (
) : query.isLoading && results.length === 0 ? (
) : results.length === 0 ? (
No results for “{inputValue}”
) : (
{(() => {
let flatIndex = 0;
return groupedResults.map((group) => (
{group.items.map((item, itemIndex) => {
const currentIndex = flatIndex++;
const isSelected = currentIndex === selectedIndex;
const title = getResultTitle(item);
const isNested = itemIndex > 0 || item.type !== "page";
const showBreadcrumb = itemIndex === 0;
return (
);
})}
));
})()}
)}