- {scope.type === "publication" && (
-
- )}
- {scope.type === "publication" && (
-
- {scope.name}
-
- )}
+ {/* Dropdown Header */}
+
{sortedSuggestions.length === 0 ? (
-
+
{searchQuery
- ? "No results found"
+ ? noResults
+ ? "No results found..."
+ : "Searching..."
: scope.type === "publication"
- ? "Type to search posts"
- : "Type to search"}
+ ? "Start typing to search posts"
+ : "Start typing to search people and publications"}
) : (
{sortedSuggestions.map((result, index) => {
const prevResult = sortedSuggestions[index - 1];
const showHeader =
- prevResult && prevResult.type !== result.type;
+ index === 0 ||
+ (prevResult && prevResult.type !== result.type);
return (
)}
- {getHeader(result.type)}
+ {getHeader(result.type, scope)}
>
)}
@@ -389,6 +406,27 @@ const PostResult = (props: {
);
};
+const ScopeHeader = (props: {
+ scope: MentionScope;
+ handleScopeChange: () => void;
+}) => {
+ if (props.scope.type === "default") return;
+ if (props.scope.type === "publication")
+ return (
+
+ );
+};
+
export type Mention =
| { type: "did"; handle: string; did: string; displayName?: string }
| { type: "publication"; uri: string; name: string }