diff --git a/src/components/FileTree/PinnedFiles.tsx b/src/components/FileTree/PinnedFiles.tsx index 1dcf32c..b623894 100644 --- a/src/components/FileTree/PinnedFiles.tsx +++ b/src/components/FileTree/PinnedFiles.tsx @@ -8,7 +8,7 @@ import { ExplorerStore } from "src/store"; import { PinContainer, PinContent, PinHeader } from "../Pin"; type Props = { - renderFile: (file: TFile, disableDrag?: boolean) => ReactNode; + renderFile: (file: TFile, index: number, disableDrag?: boolean) => ReactNode; }; const PinnedFiles = ({ renderFile }: Props) => { const { useExplorerStore } = useExplorer(); @@ -26,8 +26,8 @@ const PinnedFiles = ({ renderFile }: Props) => { - {getDisplayedPinnedFiles().map((file) => - renderFile(file, true) + {getDisplayedPinnedFiles().map((file, index) => + renderFile(file, index, true) )} diff --git a/src/components/FileTree/index.tsx b/src/components/FileTree/index.tsx index 5aa0b5e..3bec9a0 100644 --- a/src/components/FileTree/index.tsx +++ b/src/components/FileTree/index.tsx @@ -27,9 +27,9 @@ const FileTree = ({ onOpenFoldersPane = () => {} }: Props) => { ); const { files } = useChangeFile(); - const renderFile = (file: TFile, disableDrag?: boolean) => ( + const renderFile = (file: TFile, index: number, disableDrag?: boolean) => ( {} }: Props) => { return (
- {sortedFiles.map((file) => renderFile(file))} + {sortedFiles.map((file, index) => renderFile(file, index))}
); };