- {/* Корневые папки */}
- {tree.map(folder => (
-
- ))}
+ {searchResults ? (
+ /* Результаты поиска */
+ <>
+ {searchResults.endpoints.length === 0 && searchResults.folders.length === 0 ? (
+
+
Ничего не найдено по запросу «{searchQuery}»
+
+ ) : (
+ <>
+ {searchResults.folders.map((folder: any) => (
+
+
+
{folder.name}
+
{searchResults.folderPathMap.get(folder.id)}
+
+
+
+
+
+ ))}
+ {searchResults.endpoints.map((endpoint: any) => (
+
+
+
+ {endpoint.name}
+ {endpoint.folderPath && (
+ {endpoint.folderPath}
+ )}
+
+
{endpoint.method}
+
{endpoint.path}
+
+
+
+
+
+ ))}
+ >
+ )}
+ >
+ ) : (
+ /* Обычное дерево */
+ <>
+ {tree.map(folder => (
+
+ ))}
- {/* Корневые эндпоинты (без папки) */}
- {rootEndpoints.map(endpoint => (
-
- ))}
+ {rootEndpoints.map(endpoint => (
+
+ ))}
- {tree.length === 0 && rootEndpoints.length === 0 && (
-
-
Нет папок и эндпоинтов.
-
Создайте первую папку или эндпоинт!
-
+ {tree.length === 0 && rootEndpoints.length === 0 && (
+
+
Нет папок и эндпоинтов.
+
Создайте первую папку или эндпоинт!
+
+ )}
+ >
)}