Init collection-panel-files hoc
[arvados-workbench2.git] / src / views-components / collection-panel-files / collection-panel-files.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { connect } from "react-redux";
6 import { CollectionPanelFiles as Component, CollectionPanelFilesProps } from "../../components/collection-panel-files/collection-panel-files";
7 import { RootState } from "../../store/store";
8 import { TreeItemStatus } from "../../components/tree/tree";
9
10 const mapStateToProps = (state: RootState): Pick<CollectionPanelFilesProps, "items"> => ({
11     items: [{
12         active: false,
13         data: {
14             name: "Directory 1",
15             type: "directory"
16         },
17         id: "Directory 1",
18         open: true,
19         status: TreeItemStatus.LOADED,
20         items: [{
21             active: false,
22             data: {
23                 name: "Directory 1.1",
24                 type: "directory"
25             },
26             id: "Directory 1.1",
27             open: false,
28             status: TreeItemStatus.LOADED,
29             items: []
30         }, {
31             active: false,
32             data: {
33                 name: "File 1.1",
34                 type: "file",
35                 size: 20033
36             },
37             id: "File 1.1",
38             open: false,
39             status: TreeItemStatus.LOADED,
40             items: []
41         }]
42     }, {
43         active: false,
44         data: {
45             name: "Directory 2",
46             type: "directory"
47         },
48         id: "Directory 2",
49         open: false,
50         status: TreeItemStatus.LOADED
51     }]
52 });
53
54
55 export const CollectionPanelFiles = connect(mapStateToProps)(Component);