We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/okets/folder-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
navigationUtils.ts•663 B
import { IListItem } from '../components/core/IListItem';
/**
* Finds the first navigable item in an array of items
* Returns the index of the first item where isNavigable !== false
* Returns 0 as fallback if no navigable items found
*
* Used by:
* - NavigationPanel: DOWN/RIGHT arrow switching to content panels
* - useNavigation: TAB key panel switching
*/
export function findFirstNavigableIndex(items: IListItem[]): number {
for (let i = 0; i < items.length; i++) {
const item = items[i];
if (item && item.isNavigable !== false) {
return i;
}
}
return 0; // Fallback to index 0 if no navigable items
}