|
|
@@ -3,7 +3,6 @@ import CodebaseSearchResult from "./CodebaseSearchResult"
|
|
|
import { Trans } from "react-i18next"
|
|
|
|
|
|
interface CodebaseSearchResultsDisplayProps {
|
|
|
- query: string
|
|
|
results: Array<{
|
|
|
filePath: string
|
|
|
score: number
|
|
|
@@ -13,26 +12,26 @@ interface CodebaseSearchResultsDisplayProps {
|
|
|
}>
|
|
|
}
|
|
|
|
|
|
-const CodebaseSearchResultsDisplay: React.FC<CodebaseSearchResultsDisplayProps> = ({ query, results }) => {
|
|
|
+const CodebaseSearchResultsDisplay: React.FC<CodebaseSearchResultsDisplayProps> = ({ results }) => {
|
|
|
const [codebaseSearchResultsExpanded, setCodebaseSearchResultsExpanded] = useState(false)
|
|
|
|
|
|
return (
|
|
|
- <div className="flex flex-col gap-2">
|
|
|
+ <div className="flex flex-col -mt-4 gap-1">
|
|
|
<div
|
|
|
onClick={() => setCodebaseSearchResultsExpanded(!codebaseSearchResultsExpanded)}
|
|
|
- className="font-bold cursor-pointer flex items-center justify-between px-2 py-2 rounded border bg-[var(--vscode-editor-background)] border-[var(--vscode-editorGroup-border)]">
|
|
|
+ className="cursor-pointer flex items-center justify-between px-2 py-2 border bg-[var(--vscode-editor-background)] border-[var(--vscode-editorGroup-border)]">
|
|
|
<span>
|
|
|
<Trans
|
|
|
i18nKey="chat:codebaseSearch.didSearch"
|
|
|
- components={{ code: <code></code> }}
|
|
|
- values={{ query, count: results.length }}
|
|
|
+ count={results.length}
|
|
|
+ values={{ count: results.length }}
|
|
|
/>
|
|
|
</span>
|
|
|
<span className={`codicon codicon-chevron-${codebaseSearchResultsExpanded ? "up" : "down"}`}></span>
|
|
|
</div>
|
|
|
|
|
|
{codebaseSearchResultsExpanded && (
|
|
|
- <div className="flex flex-col gap-2">
|
|
|
+ <div className="flex flex-col gap-1">
|
|
|
{results.map((result, idx) => (
|
|
|
<CodebaseSearchResult
|
|
|
key={idx}
|