-
-
-
- {["a", "b", "c", "d", "e"].map((id, i) => (
-
= 3 && "hidden sm:flex"
- )}
+ {actualLoading ? (
+
+ ) : (
+
+ {title ? (
+ <>
+ {
+ if (event.key === "Enter" || event.key === " ") {
+ event.preventDefault();
+ handleBack();
+ }
+ }}
+ className="cursor-pointer rounded-sm transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
+ icon={
+
+
+
+ }
>
-
-
-
-
-
-
-
- ))}
-
- {/* SurfSense Documentation */}
- {surfsenseDocsList.length > 0 && (
- <>
-
- SurfSense Docs
-
- {surfsenseDocsList.map((doc) => {
- const mention: MentionedDocumentInfo = {
- id: doc.id,
- title: doc.title,
- document_type: doc.document_type,
- kind: "doc",
- };
- const docKey = getMentionDocKey(mention);
- const isAlreadySelected = selectedKeys.has(docKey);
- const selectableIndex = selectableMentions.findIndex(
- (m) => getMentionDocKey(m) === docKey
- );
- const isHighlighted = !isAlreadySelected && selectableIndex === highlightedIndex;
+
{title}
+
+
+ >
+ ) : null}
- return (
-
- );
- })}
- >
- )}
+
+
+ {node.label}
+
+ {node.subtitle ? (
+
+ {node.subtitle}
+
+ ) : null}
+
+ {node.type === "branch" ? (
+
+ ) : null}
+
+
+ );
+ })}
+ >
+ ) : (
+
+ {hasSearch ? "No matching context" : "No items available"}
+
+ )}
- {/* User Documents */}
- {userDocsList.length > 0 && (
- <>
- {surfsenseDocsList.length > 0 && (
-
- )}
-
- Your Documents
-
- {userDocsList.map((doc) => {
- const mention: MentionedDocumentInfo = {
- id: doc.id,
- title: doc.title,
- document_type: doc.document_type,
- kind: "doc",
- };
- const docKey = getMentionDocKey(mention);
- const isAlreadySelected = selectedKeys.has(docKey);
- const selectableIndex = selectableMentions.findIndex(
- (m) => getMentionDocKey(m) === docKey
- );
- const isHighlighted = !isAlreadySelected && selectableIndex === highlightedIndex;
-
- return (
-
- );
- })}
- >
- )}
-
- {/* Folders — single source of truth is Zero (same store
- that powers the documents sidebar). Selecting a
- folder inserts a folder chip whose path the agent
- can walk with ``ls`` / ``find_documents``. */}
- {folderMentions.length > 0 && (
- <>
- {(surfsenseDocsList.length > 0 || userDocsList.length > 0) && (
-
- )}
-
Folders
- {folderMentions.map((folder) => {
- const folderKey = getMentionDocKey(folder);
- const isAlreadySelected = selectedKeys.has(folderKey);
- const selectableIndex = selectableMentions.findIndex(
- (m) => getMentionDocKey(m) === folderKey
- );
- const isHighlighted = !isAlreadySelected && selectableIndex === highlightedIndex;
-
- return (
-
- );
- })}
- >
- )}
-
- {/* Pagination loading indicator */}
- {isLoadingMore && (
-
- )}
-