bolt.new/packages/bolt/app/components/workbench/FileTreePanel.tsx

30 lines
808 B
TypeScript
Raw Normal View History

import { memo } from 'react';
import type { FileMap } from '~/lib/stores/files';
import { WORK_DIR } from '~/utils/constants';
import { renderLogger } from '~/utils/logger';
import { FileTree } from './FileTree';
interface FileTreePanelProps {
files?: FileMap;
selectedFile?: string;
unsavedFiles?: Set<string>;
onFileSelect?: (value?: string) => void;
}
export const FileTreePanel = memo(({ files, unsavedFiles, selectedFile, onFileSelect }: FileTreePanelProps) => {
renderLogger.trace('FileTreePanel');
return (
2024-07-26 09:05:53 +00:00
<div className="flex-1 overflow-y-scroll">
<FileTree
2024-07-26 09:05:53 +00:00
className="h-full"
files={files}
unsavedFiles={unsavedFiles}
rootFolder={WORK_DIR}
selectedFile={selectedFile}
onFileSelect={onFileSelect}
/>
</div>
);
});