feature: button to collapse all folders

This commit is contained in:
Kevin
2025-06-13 10:18:39 -05:00
parent c1e02065bf
commit a5768a06a1
2 changed files with 19 additions and 14 deletions

View File

@ -118,11 +118,11 @@ export const FileExplorer = ({
parentProject,
openedRows,
selectedRow,
onRowClickCallback
onRowClickCallback,
}: {
parentProject: Project,
openedRows: {[key:string]: boolean},
selectedRow: FileEntry | null,
parentProject: Project
openedRows: { [key: string]: boolean }
selectedRow: FileEntry | null
onRowClickCallback: (file: FileExplorerEntry) => void
}) => {
// Wrap the FileEntry in a FileExplorerEntry to keep track for more metadata

View File

@ -1,8 +1,11 @@
import type { Project, FileEntry } from '@src/lib/project'
import { FileExplorer, constructPath } from '@src/components/Explorer/FileExplorer'
import type {FileExplorerEntry} from '@src/components/Explorer/FileExplorer'
import {
FileExplorer,
constructPath,
} from '@src/components/Explorer/FileExplorer'
import type { FileExplorerEntry } from '@src/components/Explorer/FileExplorer'
import { FileExplorerHeaderActions } from '@src/components/Explorer/FileExplorerHeaderActions'
import {useState} from 'react'
import { useState } from 'react'
/**
* Wrap the header and the tree into a single component
@ -52,18 +55,20 @@ export const ProjectExplorer = ({
console.log('onRefreshExplorer TODO')
}}
onCollapseExplorer={() => {
console.log('onCollapseExplorer TODO')
setOpenedRows({})
}}
></FileExplorerHeaderActions>
</div>
</div>
<div className="h-96 overflow-y-auto overflow-x-hidden">
{project && <FileExplorer
parentProject={project}
openedRows={openedRows}
selectedRow={selectedRow}
onRowClickCallback={onRowClickCallback}
></FileExplorer>}
{project && (
<FileExplorer
parentProject={project}
openedRows={openedRows}
selectedRow={selectedRow}
onRowClickCallback={onRowClickCallback}
></FileExplorer>
)}
</div>
</div>
)