diff --git a/src/components/search/SearchView.tsx b/src/components/search/SearchView.tsx index 0113280..9b12095 100644 --- a/src/components/search/SearchView.tsx +++ b/src/components/search/SearchView.tsx @@ -1,6 +1,7 @@ import { useState, useRef, useEffect } from "react"; import { NDKEvent } from "@nostr-dev-kit/ndk"; -import { searchNotes, searchUsers } from "../../lib/nostr"; +import { searchNotes, searchUsers, getStoredRelayUrls } from "../../lib/nostr"; +import { getNip50Relays } from "../../lib/nostr/relayInfo"; import { useUserStore } from "../../stores/user"; import { useUIStore } from "../../stores/ui"; import { shortenPubkey } from "../../lib/utils"; @@ -48,17 +49,10 @@ function UserRow({ user }: { user: ParsedUser }) { return (
Search notes with NIP-50 full-text, or use #hashtag to browse topics.
-NIP-50 requires relay support — results vary by relay.
++ Use #hashtag to browse topics, or type a keyword for full-text search. +
+ {nip50Relays !== null && ( ++ {nip50Count === 0 + ? "None of your relays support full-text search — #hashtag search always works." + : `${nip50Count} of ${allRelays.length} relay${allRelays.length !== 1 ? "s" : ""} support full-text search.`} +
+ )}Your relays may not support NIP-50 full-text search.
} + {/* Zero results for full-text search */} + {searched && totalResults === 0 && !isHashtag && ( ++ No results for {query}. +
+ + {/* Relay NIP-50 status */} + {nip50Relays !== null && ( ++ {noNip50 + ? "None of your relays support full-text search." + : `${nip50Count} of ${allRelays.length} relay${allRelays.length !== 1 ? "s" : ""} support full-text search.`} +
+ )} + + {/* Hashtag suggestion */} + {!query.startsWith("#") && ( +Try a hashtag search instead:
+ +No notes found for {query}.
+Try a different hashtag or check your relay connections.
+No people found for {query}.
+ {noNip50 && ( +People search requires NIP-50 relay support.
+ )} +