2024-09-26 03:12:20 +00:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import { SearchResultFile } from "@/lib/types";
|
2024-09-26 06:31:51 +00:00
|
|
|
import { FileMatchContainer } from "./fileMatchContainer";
|
2024-09-26 03:12:20 +00:00
|
|
|
|
|
|
|
|
interface SearchResultsPanelProps {
|
|
|
|
|
fileMatches: SearchResultFile[];
|
|
|
|
|
onOpenFileMatch: (fileMatch: SearchResultFile) => void;
|
|
|
|
|
onMatchIndexChanged: (matchIndex: number) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const SearchResultsPanel = ({
|
|
|
|
|
fileMatches,
|
|
|
|
|
onOpenFileMatch,
|
|
|
|
|
onMatchIndexChanged,
|
|
|
|
|
}: SearchResultsPanelProps) => {
|
2024-09-26 06:31:51 +00:00
|
|
|
return fileMatches.map((fileMatch, index) => (
|
|
|
|
|
<FileMatchContainer
|
|
|
|
|
key={index}
|
|
|
|
|
file={fileMatch}
|
|
|
|
|
onOpenFile={() => {
|
|
|
|
|
onOpenFileMatch(fileMatch);
|
|
|
|
|
}}
|
|
|
|
|
onMatchIndexChanged={(matchIndex) => {
|
|
|
|
|
onMatchIndexChanged(matchIndex);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
))
|
2024-09-26 03:12:20 +00:00
|
|
|
}
|