File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 37
37
<FileTree {tree } />
38
38
{/each }
39
39
</div >
40
+ <div class =" py-4 px-3 dark:text-gray-400 text-gray-500 flex space-x-2 my-auto" >
41
+ <Icon icon =" bi:filetype-pdf" class =" my-auto text-base" />
42
+ <p class =" text-sm my-auto" >
43
+ {registry .length }
44
+ </p >
45
+ </div >
40
46
<div class =' fixed bottom-0 right-0 p-4 hover:text-blue-nordic' >
41
47
<a class =' mx-auto hover:underline hover:text-blue-400 transition-all duration-150 font-light'
42
48
href =' https://github.com/mnerv/notes'
Original file line number Diff line number Diff line change @@ -8,9 +8,15 @@ export type NodeT = {
8
8
}
9
9
10
10
export function sortByType ( list : NodeT [ ] ) : NodeT [ ] {
11
+ if ( list === null || list . length == 0 ) return [ ]
11
12
const directory = list . filter ( a => a . href === '' )
12
13
const files = list . filter ( a => a . href !== '' )
13
- return [ ...directory , ...files ]
14
+ const sortedList = [ ...directory , ...files ]
15
+ // sort childrens
16
+ return sortedList . map ( n => {
17
+ n . children = sortByType ( n . children )
18
+ return n
19
+ } )
14
20
}
15
21
16
22
export function sortByName ( list : NodeT [ ] ) : NodeT [ ] {
You can’t perform that action at this time.
0 commit comments