1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
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';
13 export interface ProjectsTreePickerProps {
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;
22 export const ProjectsTreePicker = ({ pickerId, ...props }: ProjectsTreePickerProps) => {
23 const { home, shared, favorites } = getProjectsTreePickerIds(pickerId);
25 <HomeTreePicker pickerId={home} {...props} />
26 <SharedTreePicker pickerId={shared} {...props} />
27 <FavoritesTreePicker pickerId={favorites} {...props} />