1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { CollectionFile, CollectionDirectory, CollectionFileType } from '../../../models/collection-file';
6 import { Tree, TreeNode } from '../../../models/tree';
8 export type CollectionPanelFilesState = Tree<CollectionPanelDirectory | CollectionPanelFile>;
10 export interface CollectionPanelDirectory extends CollectionDirectory {
15 export interface CollectionPanelFile extends CollectionFile {
19 export const mapCollectionFileToCollectionPanelFile = (node: TreeNode<CollectionDirectory | CollectionFile>): TreeNode<CollectionPanelDirectory | CollectionPanelFile> => {
22 value: node.value.type === CollectionFileType.DIRECTORY
23 ? { ...node.value, selected: false, collapsed: true }
24 : { ...node.value, selected: false }