{/* Search input */}
{ setQuery(e.target.value); setSelectedIndex(0) }}
onKeyDown={handleKeyDown}
placeholder="Search flows, ask a question, navigate…"
className="flex-1 bg-transparent text-sm text-foreground placeholder:text-muted-foreground outline-hidden"
/>
ESC
{/* Results */}
{isSearching ? (
) : hasQuery && flatItems.length === 0 ? (
No results for “{query}”
) : builtGroups.length > 0 ? (
{builtGroups.map(group => {
const groupStart = globalIdx
globalIdx += group.items.length
return (
{/* Section label */}
{group.label}
{group.items.map((item, i) => {
const itemGlobalIdx = groupStart + i
const isSelected = itemGlobalIdx === selectedIndex
const isFlowPilot = item.group === 'flowpilot'
if (isFlowPilot) {
// Special prominent styling for question intent at top
return (
)
}
return (
)
})}
)
})}
) : (
{isEmpty
? 'Type to search flows, pages, or ask FlowPilot a question'
: 'Type to search flows and sessions'}
)}
{/* Footer hints */}
{flatItems.length > 0 && (
↑↓
Navigate
↵
Open
)}