Using folder outline for empty folders.

This commit is contained in:
Roland 2023-02-14 08:08:04 -07:00
parent 207991ad80
commit f1f1f42a1c
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
4 changed files with 35 additions and 70 deletions

View file

@ -29,7 +29,7 @@ function depthIndentation(path) {
function Folder({folder, onFolderClick, sortData, selectedPath, onFileClick, onSelect}) {
// Creates a single table row for a folder, or a row for itself and indented rows for its children.
let {path, children} = folder;
let {path, children, is_empty} = folder;
const pathWithNoTrailingSlash = path.substring(0, path.length - 1);
const name = path.substring(pathWithNoTrailingSlash.lastIndexOf('/') + 1);
const f = <TableRow key={path}>
@ -38,10 +38,10 @@ function Folder({folder, onFolderClick, sortData, selectedPath, onFileClick, onS
</TableCell>
<TableCell onClick={() => onFolderClick(path)} className='file-path'>
{depthIndentation(pathWithNoTrailingSlash)}
<Icon name='folder'/>
{is_empty ? <Icon name='folder outline'/> : <Icon name='folder'/>}
{name}
</TableCell>
<TableCell>({folder['child_count']})</TableCell>
<TableCell/>
</TableRow>;
if (children && !_.isEmpty(children)) {
// Folder has children, recursively display them.