@a24z/dynamic-file-tree
Version:
React component for selective directory filtering and file tree visualization
40 lines • 1.63 kB
TypeScript
import type { Theme } from '@a24z/industry-theme';
import { FileTree } from '@principal-ai/repository-abstraction';
import React from 'react';
export type GitStatus = 'M' | 'A' | 'D' | 'R' | 'C' | 'U' | '??' | '!!' | 'AM' | 'MM' | null;
export interface GitFileStatus {
filePath: string;
indexStatus: string;
workingTreeStatus: string;
status: GitStatus;
}
export type SortBy = 'lastModified' | 'size' | 'name' | 'gitStatus';
export type SortOrder = 'asc' | 'desc';
export interface GitOrderedFileListProps {
/** The file tree to extract and display files from */
fileTree: FileTree;
/** Theme for styling the component */
theme: Theme;
/** Git status data for files */
gitStatusData: GitFileStatus[];
/** Callback when a file is selected */
onFileSelect?: (filePath: string) => void;
/** Optional padding for the container */
padding?: string;
/** Currently selected file path */
selectedFile?: string;
/** What to sort by (default: 'lastModified') */
sortBy?: SortBy;
/** Sort order: 'asc' (ascending) or 'desc' (descending, default) */
sortOrder?: SortOrder;
/** Show only files with git changes (default: false) */
showOnlyChanged?: boolean;
/** Optional callback for context menu */
onContextMenu?: (event: React.MouseEvent, filePath: string) => void;
}
/**
* GitOrderedFileList component displays all files from a file tree
* with git status indicators, in a flat list ordered by various criteria
*/
export declare const GitOrderedFileList: React.FC<GitOrderedFileListProps>;
//# sourceMappingURL=GitOrderedFileList.d.ts.map