+ {/* Results Header - contextual based on loading state */}
+
+ {loading ? (
+
+ Searching for "{lastQuery}"...
+ ) : (
+
+
+ {results.length} results for "{lastQuery}"
+
+ {searchTime && (
+
+ {searchTime > 1000 ? `${(searchTime/1000).toFixed(1)}s` : `${searchTime}ms`}
+
+ )}
+
+ )}
+ {!loading && remaining > 0 && remaining < limit && (
+
{remaining} remaining
)}
- {remaining > 0 && remaining < limit && (
-
{remaining} remaining
- )}
-
- {/* Loading State */}
- {loading && (
-
-
-
+ {/* Loading State */}
+ {loading && (
+
+
+
Searching codebase...
+
This may take a few seconds for first search
-
Searching codebase...
-
This may take a few seconds for first search
-
- )}
-
- {/* Results Content (only when not loading) */}
- {!loading && (
- <>
- {(remaining <= 0 || rateLimitError) && (
-
- You've reached today's limit
-
- {rateLimitError || 'Sign up to get unlimited searches and index your own repos.'}
-
-
-
- )}
+ )}
-
- {results.map((result, idx) => (
-
-
-
-
-
{result.name}
- {result.type.replace('_', ' ')}
-
-
{result.file_path.split('/').slice(-2).join('/')}
-
-
-
{(result.score * 100).toFixed(0)}%
-
match
-
-
-
- {result.code}
-
+ {/* Results List */}
+ {!loading && (
+ <>
+ {(remaining <= 0 || rateLimitError) && (
+
+ You've reached today's limit
+
+ {rateLimitError || 'Sign up to get unlimited searches and index your own repos.'}
+
+
- ))}
-
+ )}
- {results.length === 0 && (
-
-
🔍
-
No results found
-
Try a different query
+
+ {results.map((result, idx) => (
+
+ ))}
- )}
- >
- )}
-
-
- )}
- {/* ============ STORY SECTIONS (only before search) ============ */}
- {!hasSearched && (
+ {results.length === 0 && (
+
+
🔍
+
No results found
+
Try a different query
+
+
+ )}
+ >
+ )}
+
+