export interface NestedTreeItem { id: number; title: string; type: 'directory' | 'file'; description?: string; children: NestedTreeItem[]; } export interface FlatTreeItem { id: number; title: string; type: 'directory' | 'file'; description?: string; parentId: number | null; } export const nestedTreeItems: NestedTreeItem[] = [ { id: 1, title: 'Documents', type: 'directory', description: 'All your important documents', children: [ { id: 2, title: 'Project', type: 'directory', children: [ { id: 3, title: 'Weekly Report', type: 'file', description: 'Summary of weekly activities and progress', children: [], }, { id: 4, title: 'Budget', type: 'file', children: [] }, { id: 5, title: 'Presentations', type: 'directory', description: 'Quarterly and annual presentations', children: [ { id: 6, title: 'Q1 Review', type: 'file', children: [] }, { id: 7, title: 'Q2 Review', type: 'file', description: 'Second quarter performance review', children: [], }, { id: 8, title: 'Annual Summary', type: 'file', children: [] }, ], }, ], }, { id: 9, title: 'Personal', type: 'directory', children: [ { id: 10, title: 'Resume', type: 'file', description: 'Updated professional resume', children: [], }, { id: 11, title: 'Cover Letter', type: 'file', children: [] }, ], }, { id: 12, title: 'README.md', type: 'file', children: [] }, ], }, { id: 13, title: 'Photos', type: 'directory', children: [ { id: 14, title: '2025', type: 'directory', description: 'Photos from last year', children: [ { id: 15, title: 'Vacation', type: 'directory', children: [ { id: 16, title: 'Beach 1', type: 'file', children: [] }, { id: 17, title: 'Beach 2', type: 'file', description: 'Beautiful sunset at the beach', children: [], }, { id: 18, title: 'Sunset', type: 'file', children: [] }, ], }, { id: 19, title: 'Work Events', type: 'directory', description: 'Company events and gatherings', children: [ { id: 20, title: 'Conference', type: 'file', children: [] }, { id: 21, title: 'Team Building', type: 'file', children: [] }, ], }, ], }, { id: 22, title: '2026', type: 'directory', children: [{ id: 23, title: 'New Year', type: 'file', children: [] }], }, ], }, { id: 24, title: 'Downloads', type: 'directory', description: 'Recently downloaded files', children: [ { id: 25, title: 'invoice.pdf', type: 'file', description: 'January invoice for services', children: [], }, { id: 26, title: 'setup.exe', type: 'file', children: [] }, { id: 27, title: 'Archives', type: 'directory', children: [ { id: 28, title: 'backup-2025.zip', type: 'file', description: 'Full system backup from December 2025', children: [], }, { id: 29, title: 'backup-2024.zip', type: 'file', children: [] }, ], }, ], }, ]; // Generate additional items to reach 1000 total function generateNestedTreeItems(): NestedTreeItem[] { const baseItems = [...nestedTreeItems]; let currentId = 30; // Start after existing items // Add more root folders for (let i = 0; i < 10; i++) { const rootFolder: NestedTreeItem = { id: currentId++, title: `Folder ${i + 1}`, type: 'directory', description: i % 3 === 0 ? `Description for Folder ${i + 1}` : undefined, children: [], }; // Add 3 levels of nested items for (let level1 = 0; level1 < 8; level1++) { const level1Folder: NestedTreeItem = { id: currentId++, title: `Subfolder ${i + 1}.${level1 + 1}`, type: 'directory', description: level1 % 4 === 0 ? `Level 1 subfolder description` : undefined, children: [], }; // Add files and subfolders for (let level2 = 0; level2 < 10; level2++) { if (level2 % 3 === 0) { // Add subfolder with files const level2Folder: NestedTreeItem = { id: currentId++, title: `Category ${i + 1}.${level1 + 1}.${level2 + 1}`, type: 'directory', children: [], }; // Add files to this subfolder for (let level3 = 0; level3 < 5; level3++) { level2Folder.children.push({ id: currentId++, title: `Item ${i + 1}.${level1 + 1}.${level2 + 1}.${level3 + 1}`, type: 'file', description: level3 % 2 === 0 ? `File description` : undefined, children: [], }); } level1Folder.children.push(level2Folder); } else { // Add direct file level1Folder.children.push({ id: currentId++, title: `File ${i + 1}.${level1 + 1}.${level2 + 1}`, type: 'file', children: [], }); } } rootFolder.children.push(level1Folder); } baseItems.push(rootFolder); } return baseItems; } export const nestedTreeItemsLarge = generateNestedTreeItems(); export const flatTreeItems: FlatTreeItem[] = [ { id: 1, title: 'Documents', type: 'directory', description: 'All your important documents', parentId: null }, { id: 2, title: 'Project', type: 'directory', parentId: 1 }, { id: 3, title: 'Weekly Report', type: 'file', description: 'Summary of weekly activities and progress', parentId: 2, }, { id: 4, title: 'Budget', type: 'file', parentId: 2 }, { id: 5, title: 'Presentations', type: 'directory', description: 'Quarterly and annual presentations', parentId: 2 }, { id: 6, title: 'Q1 Review', type: 'file', parentId: 5 }, { id: 7, title: 'Q2 Review', type: 'file', description: 'Second quarter performance review', parentId: 5 }, { id: 8, title: 'Annual Summary', type: 'file', parentId: 5 }, { id: 9, title: 'Personal', type: 'directory', parentId: 1 }, { id: 10, title: 'Resume', type: 'file', description: 'Updated professional resume', parentId: 9 }, { id: 11, title: 'Cover Letter', type: 'file', parentId: 9 }, { id: 12, title: 'README.md', type: 'file', parentId: 1 }, { id: 13, title: 'Photos', type: 'directory', parentId: null }, { id: 14, title: '2025', type: 'directory', description: 'Photos from last year', parentId: 13 }, { id: 15, title: 'Vacation', type: 'directory', parentId: 14 }, { id: 16, title: 'Beach 1', type: 'file', parentId: 15 }, { id: 17, title: 'Beach 2', type: 'file', description: 'Beautiful sunset at the beach', parentId: 15 }, { id: 18, title: 'Sunset', type: 'file', parentId: 15 }, { id: 19, title: 'Work Events', type: 'directory', description: 'Company events and gatherings', parentId: 14 }, { id: 20, title: 'Conference', type: 'file', parentId: 19 }, { id: 21, title: 'Team Building', type: 'file', parentId: 19 }, { id: 22, title: '2026', type: 'directory', parentId: 13 }, { id: 23, title: 'New Year', type: 'file', parentId: 22 }, { id: 24, title: 'Downloads', type: 'directory', description: 'Recently downloaded files', parentId: null }, { id: 25, title: 'invoice.pdf', type: 'file', description: 'January invoice for services', parentId: 24 }, { id: 26, title: 'setup.exe', type: 'file', parentId: 24 }, { id: 27, title: 'Archives', type: 'directory', parentId: 24 }, { id: 28, title: 'backup-2025.zip', type: 'file', description: 'Full system backup from December 2025', parentId: 27, }, { id: 29, title: 'backup-2024.zip', type: 'file', parentId: 27 }, ]; // Lazy-loadable tree items export interface LazyTreeItem { id: number; title: string; type: 'directory' | 'file'; description?: string; hasChildren?: boolean; children?: LazyTreeItem[]; } export const lazyTreeItems: LazyTreeItem[] = [ { id: 1, title: 'Documents', type: 'directory', description: 'All your important documents', hasChildren: true }, { id: 13, title: 'Photos', type: 'directory', hasChildren: true }, { id: 24, title: 'Downloads', type: 'directory', description: 'Recently downloaded files', hasChildren: false }, ]; export const lazyTreeItemsChildrenMap: Record = { 1: [ { id: 2, title: 'Project', type: 'directory', hasChildren: true }, { id: 9, title: 'Personal', type: 'directory', hasChildren: true }, { id: 12, title: 'README.md', type: 'file', hasChildren: false }, ], 2: [ { id: 3, title: 'Weekly Report', type: 'file', description: 'Summary of weekly activities and progress', hasChildren: false, }, { id: 4, title: 'Budget', type: 'file', hasChildren: false }, { id: 5, title: 'Presentations', type: 'directory', description: 'Quarterly and annual presentations', hasChildren: true, }, ], 5: [ { id: 6, title: 'Q1 Review', type: 'file', hasChildren: false }, { id: 7, title: 'Q2 Review', type: 'file', description: 'Second quarter performance review', hasChildren: false }, { id: 8, title: 'Annual Summary', type: 'file', hasChildren: false }, ], 9: [ { id: 10, title: 'Resume', type: 'file', description: 'Updated professional resume', hasChildren: false }, { id: 11, title: 'Cover Letter', type: 'file', hasChildren: false }, ], 13: [ { id: 14, title: '2025', type: 'directory', description: 'Photos from last year', hasChildren: true }, { id: 22, title: '2026', type: 'directory', hasChildren: true }, ], 14: [ { id: 15, title: 'Vacation', type: 'directory', hasChildren: true }, { id: 19, title: 'Work Events', type: 'directory', description: 'Company events and gatherings', hasChildren: true, }, ], 15: [ { id: 16, title: 'Beach 1', type: 'file', hasChildren: false }, { id: 17, title: 'Beach 2', type: 'file', description: 'Beautiful sunset at the beach', hasChildren: false }, { id: 18, title: 'Sunset', type: 'file', hasChildren: false }, ], 19: [ { id: 20, title: 'Conference', type: 'file', hasChildren: false }, { id: 21, title: 'Team Building', type: 'file', hasChildren: false }, ], 22: [{ id: 23, title: 'New Year', type: 'file', hasChildren: false }], 24: [ { id: 25, title: 'invoice.pdf', type: 'file', description: 'January invoice for services', hasChildren: false }, { id: 26, title: 'setup.exe', type: 'file', hasChildren: false }, { id: 27, title: 'Archives', type: 'directory', hasChildren: true }, ], 27: [ { id: 28, title: 'backup-2025.zip', type: 'file', description: 'Full system backup from December 2025', hasChildren: false, }, { id: 29, title: 'backup-2024.zip', type: 'file', hasChildren: false }, ], }; export async function loadLazyTreeItemChildren(parentId: number | string): Promise { console.debug(`Loading children for parentId: ${parentId}...`); await new Promise(resolve => setTimeout(resolve, 1000)); return lazyTreeItemsChildrenMap[parentId] ?? []; }