Add getting file size and number of collection files in main panel and side panel
[arvados-workbench2.git] / src / views-components / projects-tree-picker / projects-tree-picker.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { HomeTreePicker } from '~/views-components/projects-tree-picker/home-tree-picker';
7 import { SharedTreePicker } from '~/views-components/projects-tree-picker/shared-tree-picker';
8 import { FavoritesTreePicker } from '~/views-components/projects-tree-picker/favorites-tree-picker';
9 import { getProjectsTreePickerIds } from '~/store/tree-picker/tree-picker-actions';
10 import { TreeItem } from '~/components/tree/tree';
11 import { ProjectsTreePickerItem } from './generic-projects-tree-picker';
12
13 export interface ProjectsTreePickerProps {
14     pickerId: string;
15     includeCollections?: boolean;
16     includeFiles?: boolean;
17     showSelection?: boolean;
18     toggleItemActive?: (event: React.MouseEvent<HTMLElement>, item: TreeItem<ProjectsTreePickerItem>, pickerId: string) => void;
19     toggleItemSelection?: (event: React.MouseEvent<HTMLElement>, item: TreeItem<ProjectsTreePickerItem>, pickerId: string) => void;
20 }
21
22 export const ProjectsTreePicker = ({ pickerId, ...props }: ProjectsTreePickerProps) => {
23     const { home, shared, favorites } = getProjectsTreePickerIds(pickerId);
24     return <div>
25         <HomeTreePicker pickerId={home} {...props} />
26         <SharedTreePicker pickerId={shared} {...props} />
27         <FavoritesTreePicker pickerId={favorites} {...props} />
28     </div>;
29 };