import React from "react" import { useTranslation } from "react-i18next" import { vscode } from "@src/utils/vscode" import { StandardTooltip } from "@/components/ui" interface CodebaseSearchResultProps { filePath: string score: number startLine: number endLine: number snippet: string language: string } const CodebaseSearchResult: React.FC = ({ filePath, score, startLine, endLine }) => { const { t } = useTranslation("chat") const handleClick = () => { console.log(filePath) vscode.postMessage({ type: "openFile", text: "./" + filePath, values: { line: startLine, }, }) } return (
{filePath.split("/").at(-1)}:{startLine === endLine ? startLine : `${startLine}-${endLine}`} {filePath.split("/").slice(0, -1).join("/")} {score.toFixed(3)}
) } export default CodebaseSearchResult