mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +03:00
18 lines
521 B
TypeScript
18 lines
521 B
TypeScript
import { FolderTree } from '@/features/library/models/FolderTree';
|
|
|
|
import { LocationHead } from '../models/library';
|
|
import { useLibrary } from './useLibrary';
|
|
|
|
export function useFolders() {
|
|
const { items } = useLibrary();
|
|
|
|
const result = new FolderTree();
|
|
result.addPath(LocationHead.USER, 0);
|
|
result.addPath(LocationHead.COMMON, 0);
|
|
result.addPath(LocationHead.LIBRARY, 0);
|
|
result.addPath(LocationHead.PROJECTS, 0);
|
|
items.forEach(item => result.addPath(item.location));
|
|
|
|
return { folders: result };
|
|
}
|